Skip to Content Skip to Menu

if in lists

  • cstruck
  • cstruck
  • OFFLINE
  • Posts: 8
  • Thanks: 1
  • Karma: 0
7 years 11 months ago #289118 by cstruck
if in lists was created by cstruck
Hi,
I looked ( www.joomlapolis.com/documentation/279-community-builder/tutorials/18624-cb-html-field-and-cb-substitutions-video ) to see that I have to make seperate fields for "firstname lastname" in one line, in lists. Then I wanted to include if, to suppress some fields - public/registered. But every ( www.joomlapolis.com/documentation/18353-using-substitutions-throughout-cb ) if in this seperate fields doesn't work. What's my mistake?
CB 2.1.0, J 3.6.5

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
7 years 11 months ago #289127 by krileon
Replied by krileon on topic if in lists
No idea what you're asking, sorry. Substitutions for fields work in userlists whether description, label, or layout. This includes the IF substitutions. If for example you need a description unique to a location you can use the reason condition (note this only works for fields) as follows.

[cb:if reason="list"]This will only display when on a userlist.[/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.

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

  • cstruck
  • cstruck
  • OFFLINE
  • Posts: 8
  • Thanks: 1
  • Karma: 0
7 years 11 months ago #289133 by cstruck
Replied by cstruck on topic if in lists
I used pic1 for the field, but unlogged and logged the name appears...
Attachments:

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

  • cstruck
  • cstruck
  • OFFLINE
  • Posts: 8
  • Thanks: 1
  • Karma: 0
7 years 11 months ago #289160 by cstruck
Replied by cstruck on topic if in lists
I've tried following "if" statements for preparing different looks for my list. None is working! I wanted to display an eMail in the list only if the user is logged in, but the eMail is displayed always (logged in or not)! The normal "[firstname] [lastname]" as an "own HTML" for example is working in list.

[cb:if username="demo"]This is Demo being displayed.[/cb:if]
[cb:if viewaccesslevel !includes "1"]I am NOT Public[/cb:if]
[cb:if usergroup !includes "2"]I do NOT have Registered Usergroup[/cb:if]

or vice versa!

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

  • cstruck
  • cstruck
  • OFFLINE
  • Posts: 8
  • Thanks: 1
  • Karma: 0
7 years 11 months ago - 7 years 11 months ago #289162 by cstruck
Replied by cstruck on topic if in lists

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /home/joomlapolis824/public_html/libraries/kunena/External/Nbbc/src/BBCode.php on line 1435
works!

[cb:if user="#displayedOrMe" user_id>"0"]
Attachments:
Last edit: 7 years 11 months ago by cstruck. Reason: different look

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
7 years 11 months ago #289166 by krileon
Replied by krileon on topic if in lists
Field conditions are always based off the profile owners user object. If you need them based off the viewing user you use user="#me". If you want it to be based off the displayed user when possible then use user="#displayed". If you want it based off displayed when possible otherwise self then use user="#displayedOrMe". If you want to display something based off the profile owner being logged in you need to condition against the onlinestatus field (true/false/1/0 values should all work). See the below substitution tutorial below for further substitution usage information.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18353-using-substitutions-throughout-cb


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.

Moderators: beatnantkrileon
Powered by Kunena Forum