How to build a multi-taxonomy, multi-term query based on user input

Thanks to Otto’s excellent post on advanced taxonomy queries, I (mostly) understand how to create multi-taxonomy and multi-term queries. However, what I don’t know is how to build those dynamically based on user input. I’d really like to end up with something like Amazon.com has on their site, with check boxes next to the various terms for a taxonomy in the sidebar (and multiple lists of terms, each with a taxonomy heading). Something like this:

Taxonomy with list of terms and check boxes to select those terms

How should I go about building something like this? Displaying the content dynamically (content changes when a box is checked) would be great, but I’d certainly settle for having a “submit” button.

2 Answers
2

I am a little fuzzy on specifics of technical side, but I think general outline would be following:

  1. Interface – you will need to either submit this as form by button or JavaScript.

  2. Query variables – you will need to register custom variable(s) via query_vars filter so your custom data is not discarded from URL.

  3. Query – modify query to make complex query, using custom data submitted.

Leave a Comment