1

I have a page view with a category taxonomy menu and a city jump menu. I want them to work together so that if the view shows all content and a user clicks on a category in the menu, the view will be fitered by category and if the user chooses a city in the jump menu, the view will be filtered by city. If a category has already been chosen and the user selects a city, the view should be filtered by both category and city and vice versa.

I know this should be possible but I don't know where to start or what the best way of doing it might be. If the best solution requires coding, I am capable of doing it.

  • Have you ever used views exposed filters? – Boriana Ditcheva Jul 17 '13 at 21:16
  • I've never heard of it and Google didn't turn up an exact match. What is it? – user320691 Jul 17 '13 at 21:31
  • Was the below what you were looking for or did I misunderstand your question? – Boriana Ditcheva Jul 19 '13 at 4:08
  • Boriana, I was looking for a way to filter content by taxonomy terms via the URL (which I think would require a contextual filter) so that when the user clicks on a Category in the menu, all content in that category would be shown and, if a City is chosen from a jump menu when a Category has been already been selected, it would filter by both City and Category. I have them working independently now but getting them to work together migh require a module. Anyway I appreciate your detailed and nicely presented answer and have subscribed to your RSS feed. Thank you. – user320691 Jul 22 '13 at 19:08
  • Well - I've edited my response based on your comment, but I realize the modules I'm pointing you to may be overkill. It's just what I thought of. :-) Hope you manage to figure it out! – Boriana Ditcheva Jul 24 '13 at 21:32
1

I'm editing my response based on your latest comment!

============================================================

One way I think you can do what you're trying to do is incorporate facets into your page with those specific taxonomy terms placed on the page as facets.

You'd need to use the Facet API module and the Faceted Navigation for Search module. You can see the module page for an example interface - do you see how the screenshot on the module page shows a site where you can narrow the results based on fields/facets on the side? I'm adding a screenshot from a site of my own that I've set up to use facets, though it's themed very differently. The other great thing about facets is that they show you how many nodes you have tagged with the fields/terms you want to filter on.

enter image description here

Essentially, what facets do is give you the ability to FILTER/narrow listings based on select-type fields or taxonomy terms. You can combine these filters, just as you describe.

I've only used the facet api with solr search, not core drupal, so I don't know if I can help you much on the exact setup, but perhaps this can at least guide you into another potential way to achieve your goal (if it's not overkill to learn all about facets and how you may be able to do this through search).

Let us know how it works out or if you figure it out!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.