3

I'm trying to display certain blocks in taxonomy term pages and the nodes associated based on the taxonomy term itself.

Let's say I have 3 taxonomy terms: Bologna, Milan and Rome.

When I'm in Bologna taxonomy-term page I would like to display a block that show the map of Bologna, when I'm in Milan taxonomy-term page the Milan map and so on.

Context module seems to work with node associated to a particular taxonomy term (for example, I'm able to display Milan map block in every node associated with Milan taxonomy term), but doesn't work for the taxonomy page itself.

I think the trick is in Panels. I've enabled the taxonomy-term page override but I do not know how to display blocks based on arguments.

I've used views and panels many times before but never faced this particular problem: It's a bit different that filtering with arguments particular nodes or content types.

1 Answer 1

0

Kropot,

Have you tried views contextual filters?

  1. Create a block view.
  2. Add a Contextual filters with Content: Has taxonomy term ID.
  3. defalt value: Taxonomy Term ID from URL
  4. Add the fields to display.
  5. Add the filters.

Deepak

6
  • Thank you for the answer @deepak-ml This works when you have to display a particular content based on taxonomy term ID. But how to do that when you want to display particular blocks based on taxonomy term? Block_A in taxonomy_term_A page, Block_B in taxonomy_term_B page, and so on (using Panels).
    – Kropot
    Mar 19, 2013 at 13:22
  • how are the different blocks Block_A Block_B etc are related to the terms ?
    – Deepak ML
    Mar 19, 2013 at 13:26
  • This is exactly the problem :) How to relate blocks with the terms? There is a similar question here I wasn't able to find a solution using Context module The block_term module seems to be in alpha state and it doesn't mention integrations with views.
    – Kropot
    Mar 19, 2013 at 13:37
  • 1
    With a content type eg. relative_block with fields image and taxonomy reference ( same vocabulary as actual content type ) and actual content type where you reference the term. The views block will display the image field associated with that term.
    – Deepak ML
    Mar 19, 2013 at 13:37
  • Yep, I was thinking at the same workaround: in my case, creating a content type called "Map" using the same vocabulary, create the content Map_A, Map_B and Map_C, then a views content pane wich displays only the body field, and then configure as usual Contextual filters and arguments in panels. Maybe we can write down a workaround :)
    – Kropot
    Mar 19, 2013 at 13:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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