Skip Navigation

[Closed] Showing content conditional of CPT one-to-many association data in CRED

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 6 replies, has 2 voices.

Last updated by Waqar 1 year, 2 months ago.

Assisted by: Waqar.

Author
Posts
#2638331

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!

#2638667

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

#2638707

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 🙂

#2639227
conditional-field-group.png

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/

#2639261

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 🙂

#2639501

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 🙂

#2640537

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.

The topic ‘[Closed] Showing content conditional of CPT one-to-many association data in CRED’ is closed to new replies.