Skip Navigation

[Resolved] Conditional group based on the taxonomy input in the post form in toolset

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/Karachi (GMT+05:00)

This topic contains 4 replies, has 2 voices.

Last updated by pramodk-2 3 years, 11 months ago.

Assisted by: Waqar.

Author
Posts
#1886641
Taxonomy - condition V1.0.png

In my requirement, the field group in post form should be visible based on the value selected in the taxonomy field.

https://toolset.com/forums/topic/post-form-conditional-group-for-taxonomy/

Referred to the above link and provided the code like below:

[cred_show_group if="($(occupants) eq 'Yes')" mode="fade-slide"]
Field group to show
[/cred_show_group]

Note: occupants - Taxonomy field slug, Yes - Taxonomy field value.

However, the code above does not seem to be working. Please suggest.

Thanks.

#1887245

Hi,

Thank you for contacting us and I'd be happy to assist.

The taxonomy term value that is used in the condition, depends on the type of the field that is being used.

For example, in case the taxonomy field is set to use the "checkbox" type, you'll use the title/name of the term


[cred_show_group if="( $(occupants) eq 'Yes' )" mode="fade-slide"]
Field group to show
[/cred_show_group]

But, if the taxonomy field is set to the "select" type field, then you'll use the term's ID:


[cred_show_group if="( $(occupants) eq '10' )" mode="fade-slide"]
Field group to show
[/cred_show_group]

( based on the screenshot, '10' is the ID of the term "Yes" )

regards,
Waqar

#1887307
Taxonomy - condition V2.0.png

Many thanks Waqar,

It is working, please look at the new image uploaded and let me know whether that is the place where you have identified term ID.

Thanks,
Pramod.

#1888445

Thanks for the update and glad that it is working.

Your understanding is correct and your new screenshot correctly points out the term ID, in the URL parameter.

#1888451

My issue is resolved now. Thanks Waqar!