Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bootstrap_barrio
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
bootstrap_barrio
Commits
fedf2929
Commit
fedf2929
authored
6 years ago
by
Alberto Siles
Browse files
Options
Downloads
Patches
Plain Diff
Add extra classes to region
parent
56e215d0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bootstrap_barrio.theme
+12
-2
12 additions, 2 deletions
bootstrap_barrio.theme
theme-settings.php
+1
-1
1 addition, 1 deletion
theme-settings.php
with
13 additions
and
3 deletions
bootstrap_barrio.theme
+
12
−
2
View file @
fedf2929
...
...
@@ -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'
;
}
}
...
...
This diff is collapsed.
Click to expand it.
theme-settings.php
+
1
−
1
View file @
fedf2929
...
...
@@ -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
,
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment