Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When using a sub-theme based on omega, overriding breadcrumbs doesn't seem to work. To reproduce:
In a sub-theme page-preprocess.inc try setting a breadcrumb via drupal_set_breadcrumb(). The theme does not appear to display the overridden breadcrumb. I believe this is due to Omega setting $vars['breadcrumb'] too early in the template request lifecycle (or possibly when setting the attribute to the zone array but it no longer is a reference variable). As a temporary fix, one can override the sub theme's region--breadcrumb.tpl.php with the following code:
<div class="<?php print $classes; ?>" <?php print $attributes; ?>>
<?php if (isset($breadcrumb)): ?>
<?php print theme('breadcrumb', array('breadcrumb' => drupal_get_breadcrumb())); ?>
<?php endif; ?>
</div>
Comments
Comment #1
marcoka CreditAttribution: marcoka commentedComment #2
Cellar Door CreditAttribution: Cellar Door commented2.x is deprecated and no longer supported
Comment #3
adraskoy CreditAttribution: adraskoy commentedAppears to still be an issue as of 7.x-3.0-rc2
Comment #4
adraskoy CreditAttribution: adraskoy commentedTraced issue to a module.
Comment #5
liquidcms CreditAttribution: liquidcms commentedi am using omega 3.1 and custom_breadcrumbs module. the cb module uses std drupal_set_breadcrumb to set breadcrumbs. this works on some pages like node/23, but it does not work on node edit page like node/34/edit.
i have verified that the correct crumb trail is passed from cb module to the drupal_set_breadcrumb() function; but the trail is not getting set. if i switch to bartik it works as expected.
Comment #6
liquidcms CreditAttribution: liquidcms commentedtried latest 3-dev and still busted.
Comment #7
liquidcms CreditAttribution: liquidcms commentedand 4.x-dev also broken
Comment #8
liquidcms CreditAttribution: liquidcms commentedi think it is actually Delta Blocks or Delta that is causing the breadcrumb to be rendered long before custom breadcrumbs can define the trail. don't know enough about how delta and omega tie in together to know what the solution for this is.. will keep digging.
Comment #9
cferthorneyI had a similar issue when I was converting a zen D6 theme to Omega sub theme in D7. I couldnt change the separator the way i wanted it. I used themename_delta_blocks_breadcrumbs and coded my breadcrumb separator as I wanted it. I then used contexts and the delta blocks to position the breadcrumb where I wanted it. I also turned off breadcrumbs in the theme settings. I was using custom breadcrumbs to create the breadcrumb but I am sure you can use the drupal_set_breadcrumb() to produce the breadcrumb trail. I realise this is a work around rather than a fix and is not identical to your issue but it may help.
David
Comment #10
msmithcti CreditAttribution: msmithcti commentedUnable to reproduce this in the latest version of Omega 4.x which would suggest this has either been fixed somewhere along the line or was an issue with a module (e.g. delta).
Feel free to open for another version or if you have more information to reproduce it in Omega 4.
Comment #11
reptilex CreditAttribution: reptilex commentedso that you cannot reproduce it in 4.1 means it is broken still under 3.1 which is stable? Because I have the same issue in 3.1
Comment #12
Cellar Door CreditAttribution: Cellar Door commentedThe issue here I think lies in Delta module: check out #1242130: Breadcrumb block generated too early; other modules can't modify breadcrumbs and see if that fixes your issues. I'll hopefully be rolling it into a new release in the near future
Comment #13
discipolo CreditAttribution: discipolo commentedi have no delta or context or breadcrumb module installed and am using omega 4.0 for my subtheme. It seems drupal_set_breadcrumb isnt working in page.preprocess.inc.
Comment #14
emcniece CreditAttribution: emcniece commentedConfirming bug in 7.x-4.0-rc1 1378993635, no delta or context or breadcrumb module installed. SUBTHEME_breadcrumb() hook appears to never actually run.
Comment #15
BoySherman CreditAttribution: BoySherman commentedI have verified the unusual behaviour when using drupal_set_breadcrumb, this however seems to be an uneeded function call. Instead of manipulating the breadcrumb via drupal_set_breadcrumb(), manipulate the breadcrumb variable directly in the breadcrumb preprocess. I have verified that this works with version 7.4
Comment #16
davidkronfeld CreditAttribution: davidkronfeld commentedI had exactly experienced the same issue with Omega 4.4 installed.
1) theme function (defined in template.php) is not run
2) and file "breadcrumb.theme.inc" is not detected
Interestingly, if you remove the file "breadcrumb.theme.inc" in the OMEGA master theme, then the file "breadcrumb.theme.inc" is detected and processed correctly.
my 2 cts...