How to customize the taxonomy term page in Drupal 7 with Views

This tutorial will show you how to use Views and change the way the taxonomy term pages show information regarding the nodes assigned with the respective term.

Generally the taxonomy term page outputs teasers of all the nodes which have been assigned with that term. So if you wanted to change what information comes out in those teasers, I suppose you can manage the display of the teaser view mode with Display Suite or something. But, what if you don’t want to change the teaser, or you simply can’t make the teaser give out the information you want on the taxonomy term page?

You can use Views to rewrite the taxonomy term page very easily. If you installed Views, you'll notice a disabled View called Taxonomy Term which emulates how the taxonomy term page looks like in default conditions. You need to rewrite that and change the data the taxonomy term page displays about its nodes.

If you want to rewrite it, it is best if you made a clone rather than edit the default one. Just in case something goes wrong and you need to revert back to the original View.

Then just give it a new name like Taxonomy Rewrite and you can start editing the clone – make sure the clone at least is enabled.

Once you start editing the View, you probably notice in the Format tab that the View shows Content – Teaser. This is what you need to change into Fields in order to select what kind of information you want displayed about each of the nodes included in the taxonomy term page. And here you can also play around, add a bunch of fields (you’ll need to add at least one), rewrite the way they output, use CSS and many other cool features.

Just like when you normally use Views, you can then sort your results, use a pager and all sorts of things. At the end of these edits, save your new View and then load a taxonomy term page. Instead of a list of teasers, it should now display a list of sets of fields about each node with that term – just like a regular View.

Hope this helps.

Comments

Notice that if you use more than 1 views to override the same term Drupal will use tha latest saved views (and may also have problems).
So I would suggest anyone to avoid having more than 1 taxonomy views for the same term or try to be more generic (eg one only taxonomy term rewrite for all terms).

Thanks for the article.
I'm trying to set up a page that has 2 tabs(by using page setting in views). I have set it up but the problem is when I click in the tab I see the taxonomy path instead of alias ? (for example taxonomy/term/6/digital instead of CCTV/digital However default menu tab still work correctly and show the alias CCTV) Is there any way to show the alias instead of taxonomy term address ?

Another vote for Taxonomy display. Simple to setup and saved me from messing on creating custom tpl files.

Add new comment