Image
Circuit board

Useful modules: Taxonomy Views Integrator

Drupal's taxonomy system is a cornerstone for organizing content, but displaying that content in dynamic and flexible ways can sometimes be a challenge. That's where the Taxonomy Views Integrator (TVI) module steps in, bridging the gap between taxonomy terms and the versatile Views module.

TVI empowers you to create custom Views displays directly within your taxonomy term pages, eliminating the need for complex contextual filters or custom code. Imagine displaying related articles, products, or events directly on your category pages, all dynamically driven by the associated taxonomy term. TVI makes this, and much more, a reality.

Why TVI is a Game-Changer

  • Seamless Views Integration: Embed Views directly into taxonomy term pages with minimal configuration.
  • Dynamic Content Display: Automatically display related content based on the current taxonomy term.
  • Enhanced User Experience: Provide users with more relevant and engaging content within category pages.
  • Increased Flexibility: Customise content displays with the full power of the Views module.
  • Simplified Site Building: Reduce the need for complex workarounds and custom coding.
  • Contextual filtering: Makes contextual filtering on taxonomy pages easy.

Quick "How To" Get Started

  1. Installation: Install the Taxonomy Views Integrator module via Composer (composer require drupal/tvi).
  2. Enable TVI on Vocabulary: Navigate to "Structure" > "Taxonomy" and edit the vocabulary you want to use with TVI. In the vocabulary's settings, check the "Enable Views integration" box.
  3. Create a View: Create a new View to display the content associated with your taxonomy terms.
  4. Add a Relationship (if needed): If your content doesn't directly reference the taxonomy term, add a relationship to connect the content to the taxonomy. For example, add a relationship to the taxonomy term field on your content type.
  5. Add a Contextual Filter: Create a contextual filter on the taxonomy term ID. This will allow the view to filter content based on the current term.
  6. Configure TVI Display: In the View's display settings, add a "Taxonomy term" display.
  7. Configure TVI Settings: In the "Taxonomy term" display settings, you'll find TVI-specific options.
    1. Argument: Select the contextual filter you created in step 5.
    2. Inherit Path: decide if you want the view to inherit the taxonomy path.
  8. Configure View Fields and Filters: Customize the fields and filters of your View to display the desired content.
  9. Save the View: Save your View.
  10. Clear Cache: Clear Drupal's cache.

Example Use Case

Let's say you have an "Articles" content type and a "Categories" taxonomy vocabulary. You can use TVI to display a list of articles within each category page.

  1. Enable TVI on the "Categories" vocabulary.
  2. Create a View to display articles.
  3. Add a relationship to the "Categories" taxonomy term field on the "Articles" content type.
  4. Add a contextual filter on the taxonomy term ID.
  5. Create a "Taxonomy term" display in the View.
  6. Configure the display to use the contextual filter.

With TVI, you can transform your taxonomy pages into dynamic and engaging content hubs, providing users with a richer and more informative browsing experience. It's an essential tool for any Drupal site builder looking to leverage the full potential of Drupal's taxonomy system.

Tags

If you have any comments or a particular topic in mind for a future article, or if you'd like to explore contracting possibilities, please get in touch.