Displaying module with HTML content based on CB fields

2 months 3 weeks ago #304109 by sclarke
Hi,

I want to display some HTML content on my site, but only if the current logged in user has cb_coordinator != 1 and cb_rigger ==1 or cb_key_rigger == 1.

So, I got the CB Content module and this is what I put in the Text field:
[cb:if userdata cb_coordinator !="1" /]
[cb:if userdata cb_rigger =="1" or cb_key_rigger =="1" /]
<ul class="nav menu">
<li class="divider deeper parent"><span class="separator"> Member Listing</span>
<ul class="nav-child unstyled small">
<li><a href="/all-keyriggers" class="apprentice">Full Key Rigger Listing</a></li>
<li><a href="/all-riggers" class="apprentice">Full Rigger Listing</a></li>
</ul>
</ul>
[/cb:if]
[/cb:if]

But nothing is being displayed on the frontend when I am logged in with cb_coordinator = 0 and cb_rigger = 1 type user.

How would be the best way to go about displaying HTML code for the conditions stated above?

Thank you.
2 months 3 weeks ago #304113 by krileon
Your substitution IF syntax is not correct. Please read the below substitution tutorial carefully. Substitution IF usage examples are at the bottom.

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 - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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.
2 months 3 weeks ago #304122 by sclarke
Hi,

There isn't an example of an if using cb fields, so don't that mean you can do it?

If not, how do I do this, make a module only display depending on cb field values?

Thank you.
2 months 3 weeks ago #304126 by krileon

There isn't an example of an if using cb fields, so don't that mean you can do it?

There are several on our substitutions tutorial below at the bottom of the page.

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

If not, how do I do this, make a module only display depending on cb field values?

You'd have to use a CB Content Module with IF substitution around your content.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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.
Moderators: beatnantkrileon
Time to create page: 0.155 seconds
Facebook Twitter Google LinkedIn