Tell us what you are trying to do?
I'm trying to show conditionnal content depending on the CPT one-to-many association result in CREDs (Views and template works)
In the views and templates edit pages, the conditionnal tool allows it
[wpv-conditional if="( $(toolset_associations_lieu-et-region) eq 'montreal' )"]
But in the CREDs, the conditionnal tool seems to only use custom fields
How could I write the conditional code?
What is the link to your site?
hidden link
Thanks!
Hi,
Thank you for contacting us and I'd be happy to assist.
In form, the conditional display of fields differently than in the view and templates.
Forms offer the conditional groups for that, as explained in this guide:
https://toolset.com/course-lesson/conditional-display-for-form-inputs/
In case, you face some challenge in making this work, you're welcome to share specific details, about exactly how and where you'd like to use this conditional display.
regards,
Waqar
Good morning Waqar,
Thanks for the link. I'm not using block editor, but the expert mode (Toolet / Views), so I have to write down the code, because the conditional option seems to only take custom field settings
Catherine 🙂
If you're editing the form in the 'Expert mode', you can add a conditional field group using the 'cred_show_group' shortcode or through the 'Add conditional groups' button.
( example screenshot attached )
Here is a detailed guide on using the conditional field group in forms, manually:
https://toolset.com/documentation/programmer-reference/forms/cred-conditional-display-engine/
Good morning Waqar,
For the CRED conditional settings, my issue is that the system seems to only work with custom fields, non CPT relationships (it doesn't show in the dropdown list)
So my question is what would be the code that adds a conditionnal statement based on the CPT relationship.
Catherine 🙂
I tried to create a mix of the CRED conditional and the VIEW codes
[cred_show_group if="( $(toolset_associations_lieu-et-region) eq 'montreal' )"]
But it doesn't seem to work. Any typo?
Catherine 🙂
Good morning Catherine,
There is one important difference to remember between the conditional display shortcode ( wpv-conditional ) and the conditional form group shortcode ( cred_show_group ).
The 'conditional display shortcode' works by comparing the values saved in the database.
But the 'conditional form group shortcode' works based on the values available in the form fields, at the moment (and not what is saved in the database).
This means that we can only control conditional field groups based on the fields and their values that are available.
If you could share the link to the page where this form is in use and the exact requirement, I'll be in a better position to suggest the next steps accordingly.
Note: I already have the website's admin access details.