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

Moshe Weitzman weitzman at tejasa.com
Thu Oct 19 00:09:19 UTC 2006


Rob Barreca wrote:
> _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());
>      }
> ....

there are loads of one off ways to do this but the author is looking for a 
standard mechanism he can employ in his module. we don't have a good 
solution right now. i propsoed a hook_signal() a while back for events like 
this but it met resistance.


More information about the development mailing list