Moving breadcrumbs from zone-content to region-content (Omega, Drupal 7)
In Omega, the breadcrumbs live inside zone-content but not region-content. In the subtheme I'm working on, I need them to be inside region-content. Since they aren't explicitly printed in zone--content.tpl.php, they need to be moved with preprocessing; this answer by fubhy gives a nice starting point.
Initially I put this in template.php for testing. Here's what it looked like. As always, remember to replace MYTHEME with your theme name.
function MYTHEME_preprocess_region(&$vars) {
$theme = alpha_get_theme();
if ($vars['elements']['#region'] == 'content') {
$vars['breadcrumb'] = $theme->page['breadcrumb'];
}
}
Afterwards, I moved it to preprocess/preprocess-region.inc. Here's what it looked like there. The only difference is that in the function name, I added "alpha" after "MYTHEME."
function MYTHEME_alpha_preprocess_region(&$vars) {
$theme = alpha_get_theme();
if ($vars['elements']['#region'] == 'content') {
$vars['breadcrumb'] = $theme->page['breadcrumb'];
}
}
I mention the "alpha" addition in the preprocess folder with some hesitation. Although I've had to do this several times, I haven't figured out why the extra specificity was necessary, and I like to know why things work before I blog them. Perhaps some kind developer can clear it up in the comments.