Skip to Content Skip to Menu

[SOLVED] Hide/ Show Tab (S) based on privacy setting of another Tab

9 years 2 months ago - 9 years 2 months ago #260902 by pranaydhruv
Hello Team,

I am trying to Hide Photos Tab based on Privacy settings of the Avatar image field using CB Conditional , but unable to find Avatar image in the IF Field Drop down.Please let me know if there is any other way to achieve this ?

Thanks
Pranay
Last edit: 9 years 2 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 68625
  • Thanks: 9109
  • Karma: 1434
9 years 2 months ago #260941 by krileon
You can't condition based off the privacy settings of another tab. Do you mean you want to hide the photos tab if they haven't uploaded an avatar? That field and that tab really don't have anything in relation to one another and recommend using CB Privacy to enable privacy controls for the photos tab instead.

At any rate you should see "Profile image" in the dropdown (it displays field title, not name) for the avatar field, but that field is never truly empty and will need to use a REGEX operator with the below to determine if it's empty.

/(nophoto_n|tnnophoto_n)\.png$/


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.

9 years 2 months ago #260943 by pranaydhruv
Hello Kyle,

i am trying to set it up such that if a user hides their Profile image their Photos tab also gets hidden. that way there are no 2 seperate actions required for the same goal.

Thanks
Pranay

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 68625
  • Thanks: 9109
  • Karma: 1434
9 years 2 months ago #260950 by krileon
CB Conditional uses the PHP value of a field to condition. CB Privacy does not block the PHP value so you can't really condition from that. You'd have to try something like the below, but I've no idea if it'll work.

Display: Tab conditional
Field: Custom > Value
Value: [cb:userfield field="avatar" /]
Translate Value: No
Operator: Is REGEX
Value: /(nophoto_n|tnnophoto_n)\.png$/
Translate Value: No
Mode: Hide

That'll cause the condition to test against the HTML value (the full image tag) to ensure it's not an empty image. If that doesn't work try the "Is Empty" operator instead. Again, no idea if this will work.


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: pranaydhruv

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

9 years 2 months ago #261088 by pranaydhruv
Hello Kyle,

It works with Is Empty Operator.

Thanks
Pranay

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

Moderators: beatnantkrileon
Powered by Kunena Forum

Facebook Twitter LinkedIn