How to make a list of the taxonomy terms with Drupal

June 14th, 2007 tela

Here is a very common question I encountered while setting up websites with Drupal: How do I make a list of the taxonomy terms that will display like a menu. That is, each taxonomy term should display as a link and when you click you go to the page that displays the nodes associated with that taxonomy term.

This feature is straight forward in WordPress. And this is one I was missing in Drupal. Of course with Drupal when something is not readily available out of the box, it doesn’t mean that it’s not available at all. Actually the more I get to know Drupal the less limitations I see (quite the opposite from WordPress). But we can not say that it is really intuitive.

There is probably several ways to achieve this but the one I have chosen so far involves the Taxonomy Menu module.

So let’s say we want to create a block that we will display in the sidebar. This block should show the list of the taxonomy terms for one vocabulary term. With the same method we would also be able to display a second block relative to another vocabulary term.

At the first sight the Taxonomy Menu module might look like somehow limited but taking advantage of the capabilities of the different modules it involves it can actually turn quite powerfull.

  1. Enable the Taxonomy Menu module.
  2. Go to: Administer > Site configuration > Taxonomy Menu settings.
    There you can choose for which vocabulary you want to list the taxonomy terms.
    Once you’re done, you click Save configuration.
    The list should now display in the main Navigation menu along with “Administer”.
    This is not exactly what we wanted. Our idea was to display this menu in a separate menu.
  3. We will use the Menu module. Go to Administer > Site building > Menus.
  4. Create a new menu: click Add menu and enter the name for your new menu.
  5. Back in the Menus configuration page, you can edit the menu items created by the Taxonomy Menu module. Scroll down to locate these menu items under Navigation. Click “edit” corresponding to the vocabulary term.
  6. In the Edit menu item page, select from the dropdown list the new menu you just created before. You can also click the Expanded check box. So the menu shows the children, that is the taxonomy terms.
  7. You are almost done. Though you probably don’t want to display the vocabulary title. You can just disable it in the main Menu configuration page.
  8. Finally you need to display the block for this new menu. Go to Administer > Site building > Blocks. Locate the new menu you created under Disabled. Select from the dropdown list the location you want for your menu.

If you want to create another block for another vocabulary term, you select it in step 2. And you just follow the same steps than above with a new menu.

Entry Filed under: Drupal

4 Comments Add your own

  • 1. Tela-Web » Another &hellip  |  June 15th, 2007 at 7:49 am

    […] Previous post in Drupal […]

  • 2. borgo  |  November 6th, 2007 at 12:49 pm

    And what if I add a new term to the vocabulary? It doesnt show up automatically in the list, does it? I dont see any use of this then, I can easily create a menu and enter the links with my terms. What I would like to find… is a way to build a block or view, which pulls and shows list of terms of particular vocabulary and allows me to sort content.

  • 3. borgo  |  November 6th, 2007 at 12:53 pm

    OK, your other post was just what I was looking for :)
    http://tela-web.com/drupal/another-taxonomy-term-list-for-drupal/

  • 4. yelloroadie  |  May 5th, 2008 at 4:16 am

    This doesn’t seem to work in Drupal 6? Any news on how to make it work?

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed