Skip Navigation

[Resolved] custom hierarchical dropdown field

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

Problem:

Setup a hierarchical dropdown field in custom search form.

Solution:

It is possible with a hierarchical taxonomy.

for example:

https://toolset.com/forums/topic/custom-hierarchical-dropdown-field/#post-1669415

Relevant Documentation:

https://toolset.com/documentation/user-guides/custom-content/create-custom-taxonomies/

This support ticket is created 4 years, 5 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 3 voices.

Last updated by martinB-16 4 years, 5 months ago.

Assisted by: Luo Yang.

Author
Posts
#1667501

How can I create such a dropdown list?

GROUP 1
-Detail a
-Detail b
GROUP 2
-Detail a
-Detail b
- Detail c

#1667875

Hi Martin,

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

Can you please share some context about what these "Group" and "Detail" items represent and where you'd like this hierarchical dropdown field to appear?

I'll be in a better position to guide you accordingly.

regards,
Waqar

#1668683

Hi,
I want to use these fields in a custom post (classifieds) as a category field to use as a filter in a view.

#1669415

Hello,

It is possible with a hierarchical taxonomy.

for example, you can try these:
1) Create a custom hierarchical taxonomy:
https://toolset.com/documentation/user-guides/custom-content/create-custom-taxonomies/
Setup taxonomy terms as you mentioned above:
GROUP 1
-Detail a
-Detail b
GROUP 2
-Detail a
-Detail b
- Detail c

2) Follow our document to setup view with custom search form, display above taxonomy field as select dropdown:
https://toolset.com/course-lesson/creating-a-custom-search/

Then you will get the hierarchical dropdown as you requested in search form

#1672493

My issue is resolved now. Thank you!