0

I have two different taxonomy term views for different taxonomy vocabularies: the Blog categories the and Product types. I have an exposed filter in a block that is relevant only for the Product taxonomy term.

How do I show the filter block only on /taxonomy/term/* pages for the Product term, without the need to list them explicitly in the block settings?

2

How to make a block vocabulary-specific

You can use the Block Visibility Groups module in conjunction with the Vocabulary Condition module (linked on that page). Using those two modules together will give you a checkbox on the block to pick the vocabulary it should be shown for.

If you want to do it programmatically, the Vocabulary Condition module should be a good code reference. There's also another Vocabulary Condition module (same name, ugh!) which could also be a good reference.

Alternative idea: Use different view pages for each vocabulary

If you're using the default taxonomy term view provided by core, I'm pretty sure you can customize it so that you have one page for terms with the Product vocabulary and another for the Blog category. Then you can simply expose the filter on the view page for the relevant vocabulary.

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.