By damienmckenna on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
7.x
Introduced in version:
7.17
Issue links:
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:
/**
* 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