Override Taxonomy Term Listings
I hate the default taxonomy listing page that shows teasers of nodes. Although there are limited configuration options at Structure -> Taxonomy -> Manage Display, I want full control over how these pages look, and I don't want to work too hard to get it. With a few clicks, Views allows you to easily override these pages.
To use this tutorial you will need to install the modules Views, Views UI and CTools. This tutorial was written for Drupal 7 and Views 3.x.
- Navigate to Structure -> Views.
- Locate the view labelled, "Taxonomy term." From the dropdown menu, select, "Clone."
- Enter the view name, "Taxonomy Rewrite."
- On the configuration screen, locate the heading Format, Show. Click on "Content." A modal window will open.
- Change the setting to "Fields."
- Click "Apply" and the modal window will close.
- Locate the heading "Fields." If there is no field listed:
- Click the link "add." A modal window will open.
- Search for "title."
- Enable Content: Title (this is usually the 2nd option, you do not want Comment: Title).
- Click "Add and configure fields." The modal window will close.
- Locate the fieldset labelled, "Advanced" and click on it to reveal all of the settings.
- Under the heading Contextual filters, click on the link Taxonomy: Term ID (with depth). A modal window will open.
- Change the depth to 2. This will select sub-categories when viewing vocabularies with hierarchical relationships. If your taxonomy has a flat structure, you can omit this step.
- At the bottom of the window, click "Apply." The modal window will close.
- Check the Sort Criteria. It should include: Content: Title (asc). If it doesn't, by clicking on the "add" link and following the same procedure as is outlined in Step 5.
- Check the Pager. It should be set to display all items. If it isn't, click the link and adjust the settings.
- You are finished configuring this view. Scroll to the top and click "Save."
Your taxonomy term pages have now been customized to show only the titles of nodes with the relevant taxonomy term(s). Can you think of more ways to customize these pages? Get creative and customize your site so that it looks the way you want it to.
This tutorial was original published by the Site Building Extravaganza program where participants learned how to build a Business Directory.
Want More Tutorials?
Are you interested in getting even more tutorials sent to your inbox? Sign up for our incredibly popular tips mailing list and get a free tutorial every month. You may even win a coupon for a free e-book (include your whole name if you want to win stuff).
For a limited time we'll even send you a bonus tips sheet The Top Ten Mistakes People Make when Theming Drupal when you sign up for the list.
