1
votes

I have different nodes to which I apply taxonomy terms.

I want to display two separate blocks:

  1. The first block should list all the taxonomy terms (HTML list would be fine) and each should be clickable.

  2. The second block should list all nodes that have the taxonomy term clicked on the first block.

How would I achieve that? I am using Drupal 7 and the Views module. Thanks in advance.

1
your second requirement to have a block that lists all the nodes sounds more like a page, can you confirm this? i.e. when you click on a term in the first block it takes you to a page which lists all the nodes.D34dman
Well, basically I would like to have this only on the home page, hence the 2 blocks. Maybe I am going in the wrong direction. I just wish to have a block listing the existing taxonomy terms (as buttons) and another block below displaying all the page titles (for example) from the selected term. Does it make sense, or how would you do that?MrUpsidown
you want a single page action, something similar to views exposed filter ajax action right? In case of views exposed filter you select the term from dropdown and then click filter. If you have enabled ajax, then it loads the view without loading the whole page. But you need a block with terms instead of select list and filter button. i have an idea, but please confirm your requirement and i may post it.D34dman

1 Answers

1
votes

You need to 2 block views for this. But create just 1 view and the second view is already there in your default drupal views. Follow this steps:

  1. Create a view.
  2. Select "Taxonomy Terms" for "Show" from drop down.
  3. Select the related taxonomy vocabulary for "of type".
  4. Click on Create a Block.
  5. Click on "save & exit".

This will create your first view block with the taxonomy terms.

Now for the second block which should display all the node related to the taxonomy terms. you just have to enable a view which is "Taxonomy Term".Go down words in your drupal view list there you will find this view in a disable mode. you need to enable it. Now just override the view as you want to see that node page to display all the content related to taxonomy terms.Select the fields and filters according to normal view creation as we do. Create a page for this second block and give path as you like.

Now use Context module(download if you don't have right now) to show the taxonomy terms block on the path you have given for views.

(Hope you will be knowing how to use context if not just leave a comment i will guide you for that)