Skip to Content Skip to Menu

🌟 CB Editor Assistant 1.0.0 is here! Discover our new AI Joomla Plugin that wrote its story! (and this banner!)
Start at just $12.50/month* or 💸 save 30% with our 🛍️ Black Friday Intro Offer for your subscription's lifetime
🎉 Black Friday sale is here! Great savings on professional and developer memberships! Get 25% off now with code BLACK-FRIDAY-2024!

CB Conditional or other option to show/hide fields:

  • mz
  • mz
  • OFFLINE
  • Posts: 34
  • Thanks: 4
  • Karma: 0
6 years 10 months ago #301092 by mz
Hi,

I have two CB fields for the same information. As an example let´s imagine that we want to view a list of luggage content.
The user profile is now suppose the decide freely if he wants to link to this list of luggage content list with field type “webpage” or if he/she wants to upload a file through field type “file upload”. Or maybe user wants to do both, which supposed to be ok.

Field titles are the same for the fields but names are different.

My issue is now that I want to:

Show only one field - if both are empty.
Show the field option that has chosen by user profile and hide the unused.
Show both fields - if both fields have been filled

Or an alternative:

Request the user profile to select one or the other option on profile edit and registration page. The one selected appears on the profile view.
But the still: Show only one field - if both are empty.


Is any of this possible with CB Conditional or in any other way?

Thanks in advance

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48560
  • Thanks: 8292
  • Karma: 1445
6 years 10 months ago #301100 by krileon
You could set CB to hide empty fields within CB > Configuration > User Profile then keep both fields. They could then provide one of them, none of them, or both if they like. Regarding CB Conditional yes it could hide the other if 1 is filled in and vise verse. It could also hide one based off say a selection from a select field or radio field.


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.

  • mz
  • mz
  • OFFLINE
  • Posts: 34
  • Thanks: 4
  • Karma: 0
6 years 10 months ago #301157 by mz
Hi again,

Thanks Kyle.

I tried to use the “hide all empty fields” feature in the CB configuration and then played with select show/hide vice versa on the two fields. This does not work for me as the “hide all empty fields” feature seems to override and hide all empty fields no matter my setup….

Nevertheless I solved my issue in this case by following your suggestion - using checkboxes for the two fields. This required a third field with the checkboxes (only shown on profile if none checked - empty). Then I can control the two fields by conditioning them against selections in the checkboxes - on profile edit.

Is there any other option for making a selection choice by the user profile – for the same field?
If the user wanted to:
- select a webpage or a file
- or both
- or even multiple options

Thanks for your support.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48560
  • Thanks: 8292
  • Karma: 1445
6 years 10 months ago #301165 by krileon

I tried to use the “hide all empty fields” feature in the CB configuration and then played with select show/hide vice versa on the two fields. This does not work for me as the “hide all empty fields” feature seems to override and hide all empty fields no matter my setup….

Hide all empty fields will apply to all fields. There's no field specific hiding if empty unless you set that up in CB Conditional.

Is there any other option for making a selection choice by the user profile – for the same field?
If the user wanted to:
- select a webpage or a file
- or both
- or even multiple options

I don't understand what you mean by this. You can condition fields to show/hide using CB Conditional. If you want a multicheckbox field to show/hide more fields you can do that by simply using the contains operators when checking against a multicheckbox field.


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

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

Moderators: beatnantkrileon
Powered by Kunena Forum