Skip Navigation

[Resolved] Add Option groups to search dropdown

This support ticket is created 4 years, 6 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 5 replies, has 2 voices.

Last updated by Luo Yang 4 years, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#1989455
requirment.png

Tell us what you are trying to do?
I have a search filter for Law experts where the expert are mapped with expertise and location. I m trying to display the expertise dropdown with categories and subcategories.

Is there any documentation that you are following?
https://toolset.com/course-lesson/creating-a-custom-search/

Is there a similar example that we can see?
PFA

What is the link to your site?
hidden link

#1990015

Hello,

I assume we are talking about HTML <optgroup> Tag:
hidden link

If it is, there isn't such kind of feature within Toolset Views/Blocks plugin, since within WordPress, you can assign a post to different categories or subcategories, if you search by subcategories, you won't get those posts assigned to top level categories only.

In your case, you might consider custom codes, for example, setup the categories field with custom codes.

#1990799
WLG5.PNG
WLG4.PNG
WLG3.PNG

Thank you for your response.

I am able to achieve this by using post taxonomy. PFA (WLG3.png). However, this taxonomy is not able to map with the other post type 'Cities' PFA(WLG4.png).

Is there any way to connect one post type taxonomy to another PFA(WLG5)?

Thank you.

#1991613

Please elaborate more details for the new question:

However, this taxonomy is not able to map with the other post type 'Cities' PFA(WLG4.png).
Is there any way to connect one post type taxonomy to another PFA(WLG5)?

You can register one taxonomy two multiple post types, see our document:
https://toolset.com/course-lesson/creating-a-custom-taxonomy/

Then edit each post, and setup terms of your taxonomy.

#1992251
five.PNG
four.PNG
three.PNG
two.PNG
one.PNG

Thank you for getting back to me.

The taxonomy I created in one post type is not able to map with the other post type. I have Expertise information as a taxonomy in Law expert post type. I have added a relationship between Law expert Post type and Cities Post type and chose Expertise information as a custom field.

But I think custom coding is the best option as you suggested.

Keeping that aside, I m now facing a new issue.

As I stated earlier I have Law experts who work at multiple locations with multiple expertise.

One expert can be a child custody lawyer in NY and Divorce lawyer in Brooklyn.

I would like to display experts available based on the location or expertise information the consumer chooses.

To achieve this I have created 4 Post types:

1. Law Experts (information such as phone, email, picture, description, expertise info etc)
2. States
3. Counties
4. Cities

I have created relationships between States -> Counties, Counties -> Cities, Cities ->Law Experts.

While creating a relationship between Cities and Law experts, I chose the expertise info field in the Law Experts as the Custom field (PFA one.png).

I am displaying the Expertise info on the search page along with State->Counties->Cities dropdown. (PFA two.png)

This information mapping such as city, county, expertise info is appearing on the Law Experts as PFA three.png

However, when I am displaying expertise info as the dropdown on the search page I am unable to see the mapped expert info. I am only able to see 'All' as an option PFA four.png.

I would like to display all the expertise information (PFA five.png) on the filed on the dropdown. Please suggest.

Thank you.

New threads created by Luo Yang and linked to this one are listed below:

https://toolset.com/forums/topic/is-there-any-way-to-connect-one-post-type-taxonomy-to-another-pfa/

#1992981

I assume the original question of this thread is resolved, for other new questions, please check the new thread here:
https://toolset.com/forums/topic/is-there-any-way-to-connect-one-post-type-taxonomy-to-another-pfa/