Skip to content
Snippets Groups Projects
Commit fedf2929 authored by Alberto Siles's avatar Alberto Siles
Browse files

Add extra classes to region

parent 56e215d0
No related branches found
No related tags found
No related merge requests found
......@@ -304,9 +304,19 @@ function bootstrap_barrio_preprocess_node(&$variables) {
* Implements hook_preprocess_HOOK() for region.html.twig.
*/
function bootstrap_barrio_preprocess_region(&$variables) {
// Add a clearfix class to system branding blocks.
$nowrap = [
'breadcrumb',
'content',
'primary_menu',
'header',
'sidebar_first',
'sidebar_second',
];
if (theme_get_setting('bootstrap_barrio_region_class_' . $variables['elements']['#region']) !== NULL) {
$variables['region_classes'] = theme_get_setting('bootstrap_barrio_region_class_' . $variables['elements']['#region']);
$variables['attributes']['class'][] = theme_get_setting('bootstrap_barrio_region_class_' . $variables['elements']['#region']);
}
elseif (!in_array($variables['elements']['#region'], $nowrap)) {
$variables['attributes']['class'][] = 'row';
}
}
......
......@@ -124,7 +124,7 @@ function bootstrap_barrio_form_system_theme_settings_alter(&$form, FormStateInte
$form['layout']['region'][$name]['bootstrap_barrio_region_class_' . $name] = array(
'#type' => 'textfield',
'#title' => t('Classes for @description region', array('@description' => $description)),
'#default_value' => theme_get_setting('bootstrap_barrio_region_class_' . $name),
'#default_value' => $region_class,
'#size' => 40,
'#maxlength' => 40,
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment