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 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.

This topic contains 4 replies, has 3 voices.

Last updated by martinB-16 3 months, 1 week ago.

Assigned support staff: 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

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

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

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

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!