Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uw_cfg_common
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WCMS
uw_cfg_common
Commits
b0bbf69e
Commit
b0bbf69e
authored
4 years ago
by
Eric Bremner
Committed by
Kevin Paxman
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ISTWCMS-4493: check for sidebar in preprocess node and add class if any section has full width
parent
a36cabee
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!19
Feature/istwcms 4208 ebremner unpublishing
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
uw_cfg_common.module
+26
-0
26 additions, 0 deletions
uw_cfg_common.module
with
26 additions
and
0 deletions
uw_cfg_common.module
+
26
−
0
View file @
b0bbf69e
...
...
@@ -207,6 +207,32 @@ function uw_cfg_common_preprocess_node(&$variables) {
// an array to future proof, if there are more pages later.
$paths_for_content_moderation
=
[
'latest'
];
// ISTWCMS-4493: adding class if section has full width.
// If there is a sidebar on the node, check all sections for full width.
if
(
isset
(
$variables
[
'sidebar'
]))
{
// Get the layouts from the node.
$layouts
=
$variables
[
'node'
]
->
layout_builder__layout
->
getValue
();
// Step through each of the layouts and check for full width.
foreach
(
$layouts
as
$layout
)
{
// Get the layout settings from the section.
$settings
=
$layout
[
'section'
]
->
getLayoutSettings
();
// If the layout builder style is set to full width, then set
// the classes variable for the node and exit the loop.
if
(
$settings
[
'layout_builder_styles_style'
]
==
"uw_lbs_full_width"
)
{
// Add a class to the node for full width on a section.
$variables
[
'attributes'
][
'class'
][]
=
'uw-section-has-full-width'
;
// Break out of the loop to save computational time.
break
;
}
}
}
// Check if we are to add the content moderation place.
if
(
in_array
(
end
(
$path
),
$paths_for_content_moderation
))
{
...
...
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