[SOLVED] Assigned profile avatars are overriding uploaded images.

7 years 9 months ago - 7 years 9 months ago #283662 by spock9458
I am working with CB version 2.0.14 and Joomla 3.5.1 installations. I want to use the cb_gender field to "assign" a particular profile avatar to users who have not uploaded or selected one of their own. By using a couple of cb:if statements in the Profile Value Layout of the avatar field, I am successful in showing a "male avatar" if the gender field is "Male" and a "female avatar" if the gender field is "Female". The problem with this solution is that it overrides the uploaded image if a user wants to use their own avatar. Is there a way to use my Profile Value Layout solution ONLY if a user has not uploaded or selected an avatar from the gallery? I might be able to figure out another "conditional" statement, but don't know what "value" the avatar field uses to know whether a photo or icon has been uploaded or selected. Is there a solution to this? Thanks.

Rob Grinage
Smart Websites & Networking, LLC
Webmaster at www.nmlta.org

Please Log in to join the conversation.

7 years 9 months ago - 7 years 9 months ago #283670 by krileon
You can do this using the layout parameters for fields. Edit your avatar field within CB > Field Management and under Parameters > Layouts specify substitution usage for the Profile Value Layout. Example as follows.

[cb:if avatar!~"/(nophoto_n|tnnophoto_n)\.png$/"][value][/cb:if]
[cb:if avatar=~"/(nophoto_n|tnnophoto_n)\.png$/" and cb_gender="Female"]IMAGE HERE[/cb:if]
[cb:if avatar=~"/(nophoto_n|tnnophoto_n)\.png$/" and cb_gender="Male"]IMAGE HERE[/cb:if]


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.
The following user(s) said Thank You: bascherz

Please Log in to join the conversation.

7 years 9 months ago #283680 by spock9458
Thanks krileon!! This solution works perfectly, I really appreciate the help.

Rob Grinage
Smart Websites & Networking, LLC
Webmaster at www.nmlta.org

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.311 seconds

Facebook Twitter LinkedIn