diff options
Diffstat (limited to 'modules/taxonomy/taxonomy.api.php')
-rw-r--r-- | modules/taxonomy/taxonomy.api.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/modules/taxonomy/taxonomy.api.php b/modules/taxonomy/taxonomy.api.php index cb778c9a7..10575c575 100644 --- a/modules/taxonomy/taxonomy.api.php +++ b/modules/taxonomy/taxonomy.api.php @@ -182,6 +182,30 @@ function hook_taxonomy_term_delete($term) { } /** + * Act on a taxonomy term that is being assembled before rendering. + * + * The module may add elements to $term->content prior to rendering. This hook + * will be called after hook_view(). The structure of $term->content is a + * renderable array as expected by drupal_render(). + * + * @param $term + * The term that is being assembled for rendering. + * @param $view_mode + * The $view_mode parameter from taxonomy_term_view(). + * @param $langcode + * The language code used for rendering. + * + * @see hook_entity_view() + */ +function hook_taxonomy_term_view($term, $view_mode, $langcode) { + $term->content['my_additional_field'] = array( + '#markup' => $additional_field, + '#weight' => 10, + '#theme' => 'mymodule_my_additional_field', + ); +} + +/** * Alter the results of taxonomy_term_view(). * * This hook is called after the content has been assembled in a structured |