I'm using the Omega theme and have a zone that I need a div around for a certain content type. Trying to figure out the best way to do it. Was thinking a preprocess, but no clue which. Fairly new to Drupal so bare with me.
1 Answer
Adding something like this to the template.php of your subtheme should get you in the right direction.
function MYTHEME_alpha_preprocess_region(&$vars) {
$menu_object = menu_get_object();
if (isset($menu_object->type) && $vars['region'] == 'content') {
$vars['theme_hook_suggestions'][] = 'region__content__'.$menu_object->type;
$vars['attributes_array']['class'][] = 'region-content-'.$menu_object->type;
}
}
Then you just need to create .tpl files for them in the same way you would for other content type based tpl files (example: region--menu--page.tpl.php)