Using Taxonomy List
Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites
The Usual Way
To browse the terms under a vocabulary, simply request the URL http://example.com/taxonomy/vocabulary/ <vocabulary_machine_name>[+<vocavocabulary_machine_name> [/depth[/list[/columns]]].
For example:
http://example.com/taxonomy/vocabulary/tags
- to show all terms under the "tags" vocabulary
http://example.com/taxonomy/vocabulary/smurfs+tags
- to show all terms under the "smurfs" vocabulary then follow by terms under "tags" vocabulary
http://example.com/taxonomy/vocabulary/tags/3
- to show all terms under the "tags" vocabulary, limited to the top 3 levels of hierarchy.
http://example.com/taxonomy/vocabulary/tags/2/list
- to show all CONTENT under the "tags" vocabulary, limited to the top 2 levels of hierarchy.
http://example.com/taxonomy/vocabulary/staff_titles/1//4
- to show all terms under the "
staff_titles
" vocabulary id #3, limited to the top level of hierarchy in 4 columns.
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.
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion