How to override breadcrumbs defined by a module using a custom module? Is it possible, using a module, to override a breadcrumd definition defined in another module's hook_node_view()?


Module property_bc sets a custom breadcrumb for nodes of type Property.
Module property_bc_plus wants to override that behaviour.


property_bc implementation of hook_node_view would be:

&lt;?php
/**
 * Implementation of hook_node_view().
 */
function property_bc_node_view($node, $view_mode, $langcode) {
  if ($node-&gt;type == 'property') {
    $breadcrumb = array();
    $breadcrumb[] = l(t('Home'), NULL);
    $breadcrumb[] = l(check_plain($node-&gt;name), "user/$node-&gt;uid");
    $breadcrumb[] = l(t('Properties'), "user/$node-&gt;uid/properties");
    drupal_set_breadcrumb($breadcrumb);
  }
}
Different solution depending of your context.


Change the module order by changing their weight: http://drupal.org/node/110238
Use an other hook than is called later like hook_node_view_alter
Add a flag in your node and test against it


First module

 &lt;?php
 function property_bc_node_view($node, $view_mode, $langcode) {
      if ($node-&gt;type == 'property') {
        $breadcrumb = array();
        $breadcrumb[] = l(t('Home'), NULL);
        $breadcrumb[] = l(check_plain($node-&gt;name), "user/$node-&gt;uid");
        $breadcrumb[] = l(t('Properties'), "user/$node-&gt;uid/properties");
        $node-&gt;custom_bredcrumb_is_set = TRUE;
        drupal_set_breadcrumb($breadcrumb);
      }
    }


In your other module

    &lt;?php
    function property_bc_plus_node_view($node, $view_mode, $langcode) {
      if ($node-&gt;type == 'property' &amp;&amp; isset($node-&gt;custom_bredcrumb_is_set) &amp;&amp; $node-&gt;custom_bredcrumb_is_set != TRUE) {
        $breadcrumb = array();
        $node-&gt;custom_bredcrumb_is_set = TRUE;
        drupal_set_breadcrumb($breadcrumb);
      }

}