[development] hooks after hook_menu CALLBACKS called, but before page rendered

Rob Barreca rob at electronicinsight.com
Wed Oct 18 22:57:50 UTC 2006


_craig wrote:
> I want the opportunity to affect the breadcrumb trail already set by modules
> that used drupal_set_breadcrumb in their menu callbacks.  I want to have a
> final say on what the breadcrumb will really be.  
You could always do it in template.php. Here's a snippet of mine: It's 
not the best solution I suppose, but it works!

function _phptemplate_variables($hook, $vars) {
  switch ($hook) {
    case 'page':
      if (arg(0) == 'forward' && is_numeric(arg(1))) {
        $node = node_load(arg(1));
        _mymodule_project_set_breadcrumb($node, TRUE, array(l(t('Spread 
the word'), 'promote/'. $node->nid)));
        $vars['breadcrumb'] = theme('breadcrumb', drupal_get_breadcrumb());
      }
....


More information about the development mailing list