CB substitution issue

6 years 1 month ago #303084 by bascherz
CB substitution issue was created by bascherz
This is a rather minor thing, but it's still got me stumped (this kind of thing drives me nuts).

I am trying to do this:
[cb:if avatar =""]<img src="xxx">[/cb:if]
so I can display my own choice of avatar. But it doesn't seem to work.

I've also tried this with the same result. An image file called nophoto_n.png seems to show up when the database has nothing in the avatar field for a user.
[cb:if avatar includes "nophoto"]<img src="xxx">[/cb:if]

Just exactly what value WILL the avatar field contain if the user hasn't selected one? What's the trick to this?

Thanks in advance.

______________________
Bruce S - Vienna, VA

Please Log in to join the conversation.

6 years 4 weeks ago #303122 by krileon
Replied by krileon on topic CB substitution issue
Shouldn't be necessary to do that to have your own defaults. Edit your avatar field then under Parameters > Image Display adjust the "Pending Default" and "Empty Default" parameters as needed. Place your custom images in the below folder for them to be available in the dropdown.

/components/com_comprofiler/plugin/templates/default/images/avatar

The avatar field is never truly empty as we output the URL to the image when using raw substitutions so it'll point to the default pending or empty as needed.


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 to join the conversation.

6 years 3 weeks ago #303270 by bascherz
Replied by bascherz on topic CB substitution issue
Works for me as far as what to display. But what I was after was a way to find out if it was empty or not.

______________________
Bruce S - Vienna, VA

Please Log in to join the conversation.

6 years 3 weeks ago #303286 by krileon
Replied by krileon on topic CB substitution issue
You'd have to IF substitution condition against nophoto. Below topic shows example of how to do this with gender based defaults.

www.joomlapolis.com/forum/153-professional-member-support/234170-solved-assigned-profile-avatars-are-overriding-uploaded-images#283670


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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.576 seconds

Facebook Twitter LinkedIn