hook_term_path

Versions
6
hook_term_path($term)

Allows modules to provide an alternative path for the terms it manages.

For vocabularies not maintained by taxonomy.module, give the maintaining module a chance to provide a path for terms in that vocabulary.

"Not maintained by taxonomy.module" is misleading. It means that the vocabulary table contains a module name in the 'module' column. Any module may update this column and will then be called to provide an alternative path for the terms it recognizes (manages).

This hook should be used rather than hard-coding a "taxonomy/term/xxx" path.

See also

taxonomy_term_path()

Parameters

$term A term object.

Return value

An internal Drupal path.

Related topics

Code

developer/hooks/core.php, line 2368

<?php
function hook_term_path($term) {
  return 'taxonomy/term/'. $term->tid;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.