Forums › Forums › Search & Filter Pro › Creating Dynamic Search Filters
Tagged: dynamic filters
- This topic has 5 replies, 2 voices, and was last updated 9 years, 1 month ago by
Trevor.
-
Anonymous(Private) April 8, 2016 at 1:03 am #42014
Hello!
I’m creating a search form that will query companies in many different areas around New Zealand. The areas or organized first by District, then Region. Each District has a different set of regions. Is there a way to change the options that are selectable in the region filter depending on what is selected in Districts?
Thanks!
NickTrevor(Private) April 8, 2016 at 9:43 am #42029This can happen automatically if you enable auto count in the General options and hide zero (empty) values in each meta object on the form. This assumes that you have correctly organized the data you are filtering. I am assuming that you have separate custom taxonomies for Districts and Regions?
Anonymous(Private) April 9, 2016 at 12:55 am #42117I’ll try this out now and see if it works. What is the correct way to organize the data I am filtering? I’ve created post type called “company” and it has a district and a region. Should I make separate post types for each of these? If so, how do I do that an link them together?
Trevor(Private) April 9, 2016 at 7:52 am #42128Hi Nicholas. Are companies a Custom Post Type? If they are, in the WP Post editor for each company, as you edit or add a new one, do you want whoever is authoring them to be able to add the Districts and Regions themselves, or pick from a pre-defined list?
Secondly, will you also want pages for Regions and Districts, to be able to show the companies listed in them?
It may be that what you are trying to create is what is called a relational database, which is very hard to do in WordPress but can be faked using iframes, IF you have a flexible enough theme. I am building a demo one right now as a music ‘Gig Guide’.
Anonymous(Private) April 13, 2016 at 3:08 am #42557Hey Trevor,
Companies are indeed a custom post type.
I’m trying to create the same effect that you get with FacetWP. If I were creating this with Ruby on Rails, I’d have districts, regions, suburbs, and companies all on different tables with foreign keys..etc although here I wasn’t sure how to do this using this plugin without creating all those tables, or even if I did, I wouldn’t know how link them together.
-
AuthorPosts