Using Taxonomy List

The Usual Way

To browse the terms under a vocabulary, simply request the URL http://yoursite.com/taxonomy/vocabulary/<vid>[+<vid>][/depth[/list]].

For example:

http://example.com/taxonomy/vocabulary/1
to show all terms under vocabulary id #1
http://example.com/taxonomy/vocabulary/2+1
to show all terms under vocabulary id #2 and then follow by terms under vocabulary id #1
http://example.com/taxonomy/vocabulary/1/3
to show all terms under vocabulary id #1, limited to the top 3 levels of hierarchy.
http://example.com/taxonomy/vocabulary/1/2/list
to show all CONTENT under vocabulary id #1, limited to the top 2 levels of hierarchy.

Here's a screenshot.

Usage Note

The vocabulary's description will be shown at the top of each vocabulary's list. That description is free form and may contain HTML, so you can create a fairly robust descriptive introduction to the vocabulary, if you so choose.

Including in Another Page

While the module attempts to be very flexible, there always seems to be someone who needs just a bit more. In those cases, you may create a PHP formatted node (e.g. a page), which calls the module and might wrap some additional text around the output, or specify non-standard options.

taxonomy_list_show($str_vids, $max_depth, $op, $columns)

  • $str_vids - the string of vids, as it would be in the URL, except with spaces rather than "+" (although that would probably work too).
  • $max_depth - the maximum term depth for the list (defaults to "all").
  • $op - one of the following:
    • null - produces the normal list.
    • list - produces a list of nodes that are tagged by the selected terms (or all terms) in the vocabulary.
    • block - produces a list suitable for use in a block. It is suggested that the "$columns" be set to one (1).
  • $columns - the number of columns (cells per row) to use for the list.

Problems or Questions?

Please post support or feature requests, or bug reports on the project page, not in the general forums nor as a comment to this page.

 

Including Taxonomy List at the end of another page

iantresman - May 15, 2008 - 17:23

To include the Taxonomy List at the end of my home page,

  1. I created a new page (in Create content)
  2. Ensured that the Input format was set to PHP code
  3. Set the Publishing options to (a) Published (b) Promoted to front page
  4. In the Menu settings, set the Title to "Home", Weight= -10 (So that my first menu item is "Home")
  5. In the Body of my page, I added an introductory paragraph followed by the snippet:
    <?php
    echo taxonomy_list_show('1+3+4+5', 'all', 'block', 2);
    ?>

I have taxonomy IDs of 1, 3, 4, and 5 (no 2); Unfortunately it does not default to "all". You can discovered the taxonomy IDs of each group by visiting: Administer » Content management » Categories, and for each Category group, hover your cursor over the link "List terms" where you will the Taxonomy Group ID at the end of the URL in your Browser's status bar. eg. http://www.domain.com/drupal/admin/content/taxonomy/4

Interesting

NancyDru - May 15, 2008 - 17:54

I would have separated the two pieces, making the main text a "sticky" story. Then the TL part could be a non-sticky story.

As for the "all" why not try submitting a feature request?

Nancy Dru (formerly Nancy W. until I got married to Drupal)

What about caching the

coupet - May 15, 2008 - 18:34

What about caching the results?

----
Darly

Thanks for the suggestions,

iantresman - May 15, 2008 - 20:26

Thanks for the suggestions, always more than one way to skin a cat.

I've just found Home » Administer » Site configuration » Performance, where caching is enabled, and for my static site, I can't think of any reason why I wouldn't want caching enabled.

Even more interesting

NancyDru - May 15, 2008 - 21:23

You could use the TL blocks (specified for only the front page), placed in the content area, and even cache those.

Nancy Dru (formerly Nancy W. until I got married to Drupal)

 
 

Drupal is a registered trademark of Dries Buytaert.