Taxonomy: Integration with Menu and Views

The proper usage of taxonomy terms in the construction of a site remains elementary for a seasoned Drupal Developer. To the layperson, however, the existence of taxonomy terms themselves remains a mystery, much less an indispensable tool. The use of taxonomy in conjunction with URL paths provides an unbeatable nervous system for organizing a site, leveraging Views arguments and building powerful SEO.

The Drupal Taxonomy allows the sites users to tag information on the fly or organize information according to a predefined structure. Coupled with Clean URLs, the Drupal Taxonomy achieves more reliability than the simple Search function Drupal ships with. Taxonomies can have a definition description added to them, making them work like a sites proprietary dictionary with site content as examples. For a person new to Drupal, to think about how the URL path defines your site can be a foreign affair.

For the Galavante site, we used taxonomy terms to assist in the categorization, the delivery and the parsing of content. Most items of the site are “Article” content types, however, all can be tagged with a pre-determined taxonomy term. This taxonomy term is used to generate the path of the node so that the content becomes organized without hand holding. Therefore, content tagged as a “Destination” would have a URL path like “http://www.galavante.com/travel/destination/node_title_here”. Likewise, articles would be defined as “http://www.galavante.com/travel/article/node_title_here”.

By default, items tagged with a common taxonomy term are automatically collected on the default taxonomy term page. In the example above, clicking on the term “destination” on any node would bring you to a page with the title of “Destination”, the description of the term (if one was entered in the system) and a paged collection of teasers consisting of every node that was tagged with “Destinations”.

The Views module can filter queries by using taxonomy terms in the URL path. On every node of the site, an “Archives” list retrieves past nodes that were tagged with the same term of the current node. Rather than making a separate View for each taxonomy term, I simply instructed Views to check to see if a taxonomy term was used in the URL path and, if so, filter the Article nodes with it. In addition, I used the same term in the title of the block thereby customizing the generic block on a page by page basis.

The power in this approach can be felt when taxonomy terms are added throughout the lifespan of the site. At the outset, in the comp, within the project brief, we might have an initial list of terms; but websites have always been organic beings, growing, expanding and changing.

As a client who knows her business well, you can can see what you need based upon your experience. It remains our job, as Professional Drupal Developers, to employ our experience of the Drupal framework, of how content adjusts and changes and of the inherent system structures that will help, not hinder, the organic growth of your site.

We make these connections on a daily basis, embedding our understanding within your project goals. I hope this simple case study re-enforces what you knew to be true or opens your eyes to a simple, elegant universe.

Share This