0

I have a taxonomy menu block. I need to show this block on some taxonomy term pages for a particular vocabulary and on some content type node pages in second sidebar region (bartik theme).

How can we achieve this? Is there any module available? Or can we do it programmatically using a custom module or in the theme's template.php file?

0

I think Pathauto module could be your friend here. This module allows to define automatic url patterns for different entities, notably vocabularies, using tokens (Token module needed).
By default, you will have [term:vocabulary]/[term:name] for any taxonomy term page. Then you just have to configure your taxonomy menu block : Pages > Show block on specific pages : your-vocabulary/* (of course replace "your-vocabulary" by the name of the vocabulary you created).
The process is the same for any content type page.

Example:
Vocabulary : Fruits
Terms : Apple, Orange, Strawberry
The Apple page url would be : your-site/fruits/apple
You configure your block with : Show block on specific pages : fruits/*
And then your block will only appear on taxonomy term pages related to the vocabulary Fruits.

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.