Filter contents of 1 Dropdown with value from another dropdown.

Support General Filter contents of 1 Dropdown with value from another dropdown.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #31404
    Jeremy ParrottJeremy Parrott
    Participant

    For example let's say I have an automotive site and I have a 'Make' dropdown with "BMW, Chevy, Chrysler, Dodge, Ford, etc" and if select "Ford" I want another 'Model' dropdown to only display only Ford models like 'Focus, Mustang, F150, etc."

    Is this a good use case for Query Args? I would appreciate a link or two on how to use Query Args too.

    Thanks!

    #31407
    Long NguyenLong Nguyen
    Moderator

    Hi Jeremy,

    The post or taxonomy field does not support getting the value from a field as an argument on live click. You need to create a custom field type and add some JavaScript code to do that.
    https://docs.metabox.io/custom-field-type/

    #31435
    Jeremy ParrottJeremy Parrott
    Participant

    Can I make this work if I use the "Hierarchical [X] Whether the post type is hierarchical." checkbox and make the Model CPT a child of the Make CPT or some combination thereof?

    #31436
    Jeremy ParrottJeremy Parrott
    Participant

    There's also the "Set as parent" option in the Field group. Maybe that in combination with the above might work?

    #31449
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Yes, you can create a CPT make with some parent posts BMW, Chevy, Chrysler, Dodge, Ford and child posts. Then use the field post with the field type select_tree or checkbox_tree. Screenshot https://share.getcloudapp.com/rRuWLe2e

    The setting parent or "Set as parent" in the builder is to set the selected post in the box as the parent of the current edited post.
    https://docs.metabox.io/fields/post/#settings

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.