Skip Navigation

[Resolved] Which conditionals to use for custom post type custom fields?

This thread is resolved. Here is a description of the problem and solution.

Problem:

With Toolset Forms plugin, What I want is that if a user selects one option from a custom field, it "reveals" other fields that are related. Otherwise, it "hides" the custom fields that aren't related.

Solution:

You can control display for form sections from Forms’s GUI. This will allow to create simple display logic, involving custom fields and taxonomy.

Relevant Documentation:

https://toolset.com/documentation/programmer-reference/forms/cred-conditional-display-engine/

This support ticket is created 3 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

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/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by danielW-13 3 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#1883123

Tell us what you are trying to do?
I am trying to create nested conditionals for a large set of custom fields attached to a custom post type.

This is for a bibliography. The first conditional is to choose the type of Reference (a taxonomy). In some cases, there is also a sub-type to choose. Depending on the types chosen, input fields will display.

There is the "conditional" option in the custom field. Then there is the conditional display options for the form.

When I use the conditional option in the custom field, it does not do anything different when I go to add content. It does not reveal/hide fields based on what is selected.

How best do I design the kind of step-by-step conditionals that reveal custom fields depending on what's selected?

Is there any documentation that you are following?

https://toolset.com/course-lesson/using-toolset-conditional-block/

Is there a similar example that we can see?

Similar to Zotero or a bibliography program.

What is the link to your site?

collectingoscarwilde.com

#1883427

Hello,

It is not recommended to use nested conditional blocks, I suggest you try these:
Setup a conditional block to display a content template block:
https://toolset.com/block-item/content-template/

In above content template, setup other inner conditional block, if there are more sub-level inner conditional block, setup more content templates.

#1884593

Hello, Luo!

Thank you so much for your help.

Basically, I am trying to create custom fields for a custom post type.

What I want is that if a user selects one option from a custom field, it "reveals" other fields that are related. Otherwise, it "hides" the custom fields that aren't related.

What is the best way for me to set up my custom fields so that they only show certain custom fields based on what the user selects in other custom fields.

Thank you!

Dan

#1884631

I assume we are talking about Toolset Forms plugin, you are using Toolset Forms to create/edit posts, if it is, please check our document:
https://toolset.com/documentation/programmer-reference/forms/cred-conditional-display-engine/

Advanced Conditional Display for Form Sections

You can control display for form sections from Forms’s GUI. This will allow to create simple display logic, involving custom fields and taxonomy.

#1885337

My issue is resolved now. Thank you!