Download & Extend

Added hook_taxonomy_term_view() and standardized the process for displaying taxonomy terms

Project: 
Drupal core
Introduced in branch: 
7.x
Introduced in version: 
7.17
Description: 

Drupal 7.17 revamped the process by which taxonomy terms are prepared for display and rendered, to make it consistent with the display of other entities.

Added functions:
taxonomy_term_show($term)
taxonomy_term_view_multiple($terms, $view_mode = 'teaser', $weight = 0, $langcode = NULL)
taxonomy_term_build_content($term, $view_mode = 'full', $langcode = NULL)

Added hooks:
hook_taxonomy_term_view($term, $view_mode, $langcode) - triggered during taxonomy_term_view() and before hook_entity_view() is triggered.

API change:
hook_entity_view() is now triggered during a taxonomy term page load.

Example:

<?php
/**
* Implements hook_taxonomy_term_view().
*
* Add a new value to the taxonomy term page output.
*/
function mymodule_taxonomy_term_view($term, $view_mode, $langcode) {
 
$term->content['my_additional_field'] = array(
   
'#markup' => t('Surprise!'),
   
'#weight' => 10,
   
'#theme' => 'mymodule_my_additional_field',
  );
}
?>
Impacts: 
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done
Details: 

Provided documentation in taxonomy.api.php.

nobody click here