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.
For specific reasons I cannot use the delta breadcrumb block. I need to make $breadcrumb available in my
region--header.tpl.php file but it seems like it is only ever available inside the zone--content.tpl.php
file.
Is there a way to make $breadcrumb available in the header zone or region?
I have tried the following:
preprocess-region.inc
function kca_omega_alpha_preprocess_region(&$variables) {
if ($variables['region'] === 'header_first') {
$breadcrumb['breadcrumb'] = drupal_get_breadcrumb();
$variables['breadcrumb'] = theme_breadcrumb($breadcrumb);
print kpr ($variables); // results in BREADCRUMB = NULL
}
}
process-region.inc
function kca_omega_alpha_process_region(&$vars) {
// custom functionality here
if ($vars['region'] === 'header_first') {
$breadcrumb['breadcrumb'] = drupal_get_breadcrumb();
$vars['breadcrumb'] = theme_breadcrumb($breadcrumb);
print kpr ($vars); // same as above where BREADCRUMB = NULL
}
}
In both cases if I examine the variables then available to me inside region--header.tpl.php BREADCRUMB is always NULL.
Any help greatly appreciated!
Comments
Comment #1
Woggers CreditAttribution: Woggers commentedPlease see: http://drupal.org/node/1272866
@Kyle-Jaster solution worked like a charm!