Skip to Content Skip to Menu

[SOLVED] Problem with CB Content Module Displaying Avatar

  • 6DS
  • 6DS
  • OFFLINE
  • Posts: 10
  • Thanks: 4
  • Karma: 2
10 years 4 months ago - 10 years 4 months ago #246317 by 6DS
Hello,

I am using the CB content module to display the avatar in a module position:

<img src="[cb:userdata field="avatar" user="#displayedOrMe"/]">

When I use this and view my profile, the avatar is displayed correctly with the following output code:
<img src="images/comprofiler/317_53a113ad7296b.jpg">

However, when I view another users profile, the code is returned as such:
<img src="315_539a2e144c058.jpg">

Ultimately what I want to do is if the user is myself on my profile page, display my avatar with a bit more code to provide a link to update the image; if I'm on a different profile page then only display the avatar.
Last edit: 10 years 4 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 4 months ago #246338 by krileon
The userfield usage of avatar already includes its HTML. If you want to make it a link you can surround it with an href usage. Example as follows.

Code:
<a href="URL_HERE">[cb:userfield field="avatar" /]</a>

The userdata substitution usages is raw. It should be the entire src from live_site to the file it self. The below should give the exact same results.

[avatar]
[cb:userdata field="avatar" /]

The difference between the two is userdata can use substitution params.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • 6DS
  • 6DS
  • OFFLINE
  • Posts: 10
  • Thanks: 4
  • Karma: 2
10 years 4 months ago - 10 years 4 months ago #246408 by 6DS
Yes, I am using [cb:userdata field="avatar" /], or more accurately [cb:userdata field="avatar" user="#displayedOrMe"/] to display either myself or the user's profile page. Can you explain the difference in output?

Edit:

This can be closed. I believe this is related to my photo gallery that I am using to manage CB avatars. In the database everything is stored correctly.
Last edit: 10 years 4 months ago by 6DS.
The following user(s) said Thank You: krileon

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum