Hi,
I cannot find appripriate hook for displaying of taxonomy term page. I would need something like is hook_view for nodes but I need something for terms.

Is there any option to use some hook on taxonomy term page?

thanks
Tomas

Comments

dakman’s picture

There is no hook for the taxonomy_term_page function. However, this function is a menu callback, so you may use hook_menu_alter() to use a different callback, which could then call the taxonomy_term_page() function. This would effectively add a layer in between.

function mymodule_menu_alter(&$items) {
    $items['taxonomy/term/%taxonomy_term']['page_callback'] = 'mymodule_taxonomy_term_page';
}

function mymodule_taxonmy_term_page($term) {
    $build = taxonomy_term_page($term);

    // Add your hook code here.

    return $build;
}
internet-marketing.by’s picture

$items['taxonomy/term/%taxonomy_term']['page callback'] = 'mymodule_taxonomy_term_page';
function mymodule_taxonomy_term_page($term) {