Skip to Content Skip to Menu

Help with Content Module Conditionals

12 years 11 months ago #216704 by celestine63
Help with Content Module Conditionals was created by celestine63
Hi everyone,

I am trying to use the cb content module to pull details from a particular profile, using the following code eg.

[cb:userdata field="cb_street" user="224" /]


Which pulls the data ok, my problem is that Labels are not generated. I Therefore manualy input a label the problem arises if a field is empty "the label still shows" In community builder I know how to do a if to get around this ie.

[cb:if cb_street!=""]mycode[/cb:if]

but for the life of me, I can't figure out how to do this for a particular ID.

I hoping someone might help me out with a bit of coding help.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 49778
  • Thanks: 8511
  • Karma: 1465
12 years 11 months ago #216727 by krileon
Replied by krileon on topic Re: Help with Content Module Conditionals
Output with a format and it should render the label as well I believe. Example as follows.

[cb:userdata field="cb_street" user="224" formatting="div" /]

More on substitution usage can be found from the below tutorial.

www.allmysocials.com/directory/tutorials/item/233-substitution-usage


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.

12 years 11 months ago - 12 years 11 months ago #216784 by celestine63
Replied by celestine63 on topic Re: Help with Content Module Conditionals
Hi krileon,

Thx for your help, I just tried out the code but it still only outputted the field value no label, do you have anymore suggestions, Ideally a if conditional if possible.

I was just thinking of trying a different tack, maybe just create a new delimiter field with all the calls i need, and call that in the content module, I believe I should be able to use the if statement I already know, do you think this would work?

Regards Pete.
Last edit: 12 years 11 months ago by celestine63. Reason: Forgot something

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 49778
  • Thanks: 8511
  • Karma: 1465
12 years 11 months ago #216817 by krileon
Replied by krileon on topic Re: Help with Content Module Conditionals
Hmm, you can try the below as well; please see my substitution tutorial as it shows you your only options available.

[cb:userdata field="cb_street" user="224" output="fieldslist" formatting="div" /]


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