Skip Navigation

[Resolved] Autocomplete with Categories

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

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

This topic contains 2 replies, has 2 voices.

Last updated by hui-suanC 5 years, 9 months ago.

Author
Posts
#921585

Tell us what you are trying to do?

I am working with a very large list of taxonomies. And if I were to put everything into one select drop-down menu, it will be very bulky and difficult to search through. So what am trying to do is to have an autocomplete function, so that it is easier for the user to look for what they want.

https://toolset.com/forums/topic/autocomplete/

I have looked through this thread and I understand the basic J query aspect of it, but what I do not understand is how we are going to get all the information from the taxonomies into J query. Should I just copy and paste everything from scratch and put into J query?

Or is there a way to link up the J query with the WordPress API to somehow get the list of taxonomies?

#921926

We cannot really help with these details.

The Contractors would be the correct People to ask
https://toolset.com/contractors/

You would populate your Select Fields with data that you can for example get by PHP, but you need to "translate" it aforehead to a compatible syntax, let's say a simple HTML select Field populated with JSON would follow a syntax like {"value":"any","label":"Any"},
Depending on how what your select field will expect, you need to provide it with the data in the expected syntax.
Getting the data is easy with the WordPress API, for example you can use https://developer.wordpress.org/reference/functions/get_terms/
You can feed your select field with those terms and let the user search thru them.
Then, firing the search passes the chosen term to the search and updates the results.

#922036

Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.