I want go create a homepage that allows the user to search my blog using only drop down menus. For example, we can use the WordPress search function alongside a category select box. (User types whatever text, and results will be given within the selected category).
The concept of what I am trying to do is essentially, but instead of typing, the user will be using a drop down menu. Here is what I want to do:
1. I will create two sets of categories and subcategories
Set 1 – Property (Type and #of rooms) – Where #of rooms is a subcategory of Types.
Set 2 – Location (City and Neighborhood) – Where Neighborhood is a subcategory of Cities.
2. User would select Property type… based on that selection, the options for #of rooms will be given. Note that I intend to have more than one property type and each would have its own set of #of rooms option.
3. Then the user would move to the third drop down, city (No connection with the the previous two selections)… based on the city selected, the options for neighborhoods will be given.
4. And finally a submit button.
In sum, Set 1 determines what the user is looking for and Set 2 determines/limits the region the user is interested in.
Maybe this is a lot to ask, but I would really appreciate ant insights on the matter.
Did you manage to find anything on this because I need something similar.
I can’t provide any functional code, but the concept is fairly straight forward.
A query is made to get the applicable categories from the DB. The array returned will be an array, possibly of taxonomy objects. Step through each array element and build the HTML dropdown contents one by one, using what ever properties in each taxonomy object is useful.
When a category is selected, an AJAX like request is sent with the selected category. A similar process is followed as in the first step, except the query is different. Instead of the traditional XML response, the response is the actual HTML to be inserted in the next dropdown DOM element.
Thanks bcworkz, for taking the time to respond.
I will try to do what you have described above, since I am no expert, it will take some time, but I’ll get there.
Do you know of any good tutorials on the matter?
Sorry, no. You’ll likely have trouble finding a tutorial describing the whole process. You’ll have better luck if you break down the process into small tasks and try to find examples of each task, adapting and modifying the resulting code as needed to tie the tasks together.
You should make reasonable progress this way. If you get stuck on a particular spot, you can always ask for some help here. While I doubt any one here is willing to code for you, as long as it is clear you are doing your best on your own, most here are happy to help you out of a jam. Good luck!
BTW, sorry for the very slow response, I think I was away when you posted, when I returned, I skipped over a lot of posts. Lucky for you someone bumped your post, though it is technically against this forum’s rules 😉
- The topic ‘Search only using drop down menus’ is closed to new replies.