Forums Forums Search & Filter Pro Dynamically populate dropdown

Viewing 9 posts - 1 through 9 (of 9 total)
  • Anonymous
    #6250

    It’s possible to populate category dropdown, based on the previous category dropdown

    Exampl

    Got a dropdown of countries, when I select one I will need that the second dropdown show the wordpress subcategory of previous dropdown, examples cities of the previous selected country.

    Ross Moderator
    #6357

    Hey Raimundo, this is a feature I’m working on and will be released in the next major version.

    Thansk

    Anonymous
    #17583

    was this feature added?

    Ross Moderator
    #17592

    Nope not quite yet – I’m working on this right now – hoping for end of this month 🙂

    Anonymous
    #32208

    Hi,

    I need this too. Was this added already? Hope so!

    Ross Moderator
    #32451

    Yup, just enable the “autocount” option in the general tab.

    Then in your fields, make sure you tick “hide empty”.

    This works for taxonomy fields, and post meta (only choice type) fields

    Thanks

    Anonymous
    #32467

    Hi,

    I can’t get it to work yet. I have a test environment here: http://valleitest.staging.wpengine.com/category-and-subcategory-testpage/

    I have countries setup as main categories and cities within those countries setup as subcategories. I’ve added some posts and assigned categories and subcategories to them.

    What I would like S&F to do is give me one drop down with countries only and then populate the second drop down with the subcategories (cities) of that country only.

    First of all I can’t get the first dropdown to show me the countries only, it show categories and subcategories. Which field should I use for this? And how should I set this up?

    And which field should I use for the second drop down, and how should I set this up?

    Hope you can help me out, thanks, great plugin!!

    Ross Moderator
    #32468

    Ahhh I see – its because you are using a category field twice.

    What you should do is have a taxonomy for countries, and another taxonomy for cities – then you can get this to work – see the restrictions here:

    http://www.designsandcode.com/documentation/search-filter-pro/getting-started/adding-new-fields/#Note_Some_Restrictions

    Also read further down on how to create new taxonomies – they’re just like tags and categories.

    Thanks

    Anonymous
    #32470

    Hi Ross,

    thanks for the quick response. What you are suggesting is actually what I had before, I just ‘dumbed it down’ to understand the possibilities.

    Could you take a look here: http://valleitest.staging.wpengine.com/search-filter-shortcode-test/

    The issue I have with this setup is that drop down 1 filters by category, but drop down 2 shows all subcategory possibilities (regardless of main category choice), not only the child categories (because there is no relation, since they are different taxonomies).

    In case of countries that’s not really an issue, if a post is assigned to a city it’s obvious to which country it belongs, but we are working with ‘themes’ and it’s not always clear for the user which theme belongs to which main category…

    Do you understand my issue? Any suggestions?

    Thanks Ross!

Viewing 9 posts - 1 through 9 (of 9 total)