Skip to Content Skip to Menu

Conditionally hide Avatars in "CB Online Custom Latest" from being displayed.

  • MMDoege
  • MMDoege
  • OFFLINE
  • Posts: 98
  • Thanks: 3
  • Karma: 0
6 years 5 months ago #304564 by MMDoege
We've an integer field (cb_engagement_level) which is cumulation of selected statistical values.
CB Online Custom Latest is a great way to display user avatars in ranking order (max. no of avatars set to 12).
The left uppermost user is the one with highest score regarding field cb_engagement_level.
However (at least in early stage of building and maintaining ranks) CB Online Custom Latest displays also users with cb_engagement_level = "0".
Specific to our use case this is not at all recommended and would lead to inconsistent message.

Is there a way to hide users with score "0" from being displayed?
do not display => [cb:if cb_engagement_level ="0"]0[/cb:if]

Would appreciate any idea.
Thanks.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8277
  • Karma: 1443
6 years 5 months ago #304569 by krileon
Best you could do I guess use the default template then use "User-text" to substitute in the avatar with an IF substitution around it. Example as follows.

[cb:if cb_engagement_level>"0"][cb:userfield field="avatar" reason="list" /][/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: MMDoege

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

  • MMDoege
  • MMDoege
  • OFFLINE
  • Posts: 98
  • Thanks: 3
  • Karma: 0
6 years 2 months ago #306632 by MMDoege
Thank you, Kyle.

Works pretty fine.

However we've run into another issue when excluding users w/o having an avatar (in this case no thumbnail avatar).
User's avatar is set per default to tnnophoto_n.png when there's no upload or gallery pic or after having deleted an avatar.

#__comprofiler table returns "NULL" for avatars for these cases.
We exclude those users from User Lists by adding an advanced filter of "[where] avatar IS NOT NULL", where it works properly.

But we can' t get this running in CB Online User Module by
User-text = [cb:if cb_engagement_level > "49" and avatar != "tnnophoto_n.png"][cb:userfield field="avatar" reason="list" /][/cb:if] or
User-text = [cb:if cb_engagement_level > "49" and avatar != ""][cb:userfield field="avatar" reason="list" /][/cb:if] or
User-text = [cb:if cb_engagement_level > "49" and avatar !includes ""][cb:userfield field="avatar" reason="list" /][/cb:if]se

Any chance to get these users excluded?

Thanks.

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

Moderators: beatnantkrileon
Powered by Kunena Forum