Here is my situation (example):
I have 2 custom post types: Cities and Bars. So far I have 2 Cities (Los Angeles and Boston) and 6 Bars (3 in Los Angeles: X, Y, Z; and 3 in Boston: A, B, C). I created taxonomy also named Cities in order to be able to search for Bars that are located in specific Cities. Now, I need to create a custom search that will do the functions I explained in the attached screenshot.
1) Is it possible to create the Search that I outlined on the screenshot? If not, what are my other option to create something very similar to it.
2) From the technological perspective, did I set up my post types and taxonomy correctly in terms of relationships among them? Each Bar is a child of a corresponding City and each City is a parent of Bar (one-to-many relationship). Then I added taxonomy called Cities in order to associate each Bar with a City.
Please let me know if you need any clarifications.
Here is a link to the ticket I opened with Agnes Bury https://toolset.com/forums/topic/relationships-in-search/?key=z75EmBVrYD1L; she told me to open this ticket here.
This website basically has exactly what I want: hidden link
When you click on "Find a Professor", it asks you to type name of school first, and then searches through professors that only teach at that school. That is exactly what I need. I want to ask user to enter name of City first, and then user will be able to search through Bars that are located in that City (all other Bars in other Cities will not be displayed). So I need this kind of search for every City.
Thank you for your help.
Hello,
Q1) Is it possible to create the Search that I outlined on the screenshot? If not, what are my other option to create something very similar to it.
There isn't exact feature for the "City" taxonomy filter as your screenshot, but within custom search form of Views plugin, you can display it in other format, for example:
- Multiple select dropdown
- Radio buttons
- Checkboxes
More help:
https://toolset.com/documentation/user-guides/front-page-filters/
For the "Bar" filter, you can try with the "Text search" of Views custom search form, see above document, section "
2.5. Adding text-search for custom fields":
https://toolset.com/documentation/user-guides/front-page-filters/#2-5-adding-text-search-for-custom-fields
Q2) From the technological perspective, did I set up my post types and taxonomy correctly in terms of relationships among them?
In my opinion, the "City" taxonomy solution is better than setup "City" post type in your case, you can manage it easily as a custom taxonomy, and create new city, assign different city to different "bar" post