Skip to Content Skip to Menu

[SOLVED] Show a tab conditionally dependant on tab owner and viewer's fields

  • Buzz50
  • Buzz50
  • OFFLINE
  • Posts: 180
  • Thanks: 10
  • Karma: 2
10 years 3 months ago - 10 years 3 months ago #246889 by Buzz50
I would like to show a 'dating' tab to the viewer of the profile only if 2 conditions are met:

The owner has selected 'Show' in a Show/Hide radio button an another (settings) tab

The viewer has also selected 'Show' in a Show/Hide radio button an another (settings) tab

I can easily do this if one of the conditions is met, the first one but am struggling to work out how to do it only if both conditions are met.

Buzz50
Mike
Buzz50 Seniors
'Head Buzzer'
Last edit: 10 years 3 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8282
  • Karma: 1443
10 years 3 months ago #246901 by krileon
CB Conditionals conditions work independent of one another. The below might work.

Field: Custom > Value
Value: [cb:if user="#me" cb_myfield="1"]1[/cb:if][cb:if user="#displayed" cb_myfield="1"]1[/cb:if]
Operator: Equal To
Value: 11
Mode: Show

The idea is it uses substitutions to check that a checkbox field is checked for the viewing user and the displayed user. If it is then "1" is displayed. If both are checked then the value is "11". This means we can condition against "11" and know that both values are checked.

I can't guarantee this will work, but the Custom > Value usage does support substitutions so in theory it should. Probably will only work on profile view as well.


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.

  • Buzz50
  • Buzz50
  • OFFLINE
  • Posts: 180
  • Thanks: 10
  • Karma: 2
10 years 3 months ago - 10 years 3 months ago #246933 by Buzz50
Thank you Kyle, it does work !

My actual values are:

Value: [cb:if user="#me" cb_interesteddating="Show"]1[/cb:if][cb:if user="#displayed" cb_interesteddating="Show"]1[/cb:if]

So the result for my community site is that those who have shown an interest in dating will see each others dating tab but non-daters will not :)

Buzz50
Mike
Buzz50 Seniors
'Head Buzzer'
Last edit: 10 years 3 months ago by Buzz50.
The following user(s) said Thank You: krileon

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

Moderators: beatnantkrileon
Powered by Kunena Forum