Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
uw_fdsu_theme_resp
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_fdsu_theme_resp
Commits
b629ebc2
Commit
b629ebc2
authored
3 years ago
by
Eric Bremner
Browse files
Options
Downloads
Patches
Plain Diff
ISTWCMS-5195: updating .theme to use new services for getting out node data
parent
02456945
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!56
Feature/istwcms 5195 ebremner node theming
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
uw_fdsu_theme_resp.theme
+9
-7
9 additions, 7 deletions
uw_fdsu_theme_resp.theme
with
9 additions
and
7 deletions
uw_fdsu_theme_resp.theme
+
9
−
7
View file @
b629ebc2
...
...
@@ -350,6 +350,8 @@ function uw_fdsu_theme_resp_preprocess_node(&$variables) {
// The UW service object.
$uwService
=
\Drupal
::
service
(
'uw_cfg_common.uw_service'
);
$nodeContent
=
\Drupal
::
service
(
'uw_cfg_common.uw_node_content'
);
// The types of nodes the need preprocessing.
$nodes_to_preprocess
=
$uwService
->
uwGetNodePreprocessing
(
'full'
);
...
...
@@ -361,19 +363,16 @@ function uw_fdsu_theme_resp_preprocess_node(&$variables) {
if
(
in_array
(
$variables
[
'node'
]
->
getType
(),
$nodes_to_preprocess
)
||
in_array
(
$variables
[
'node'
]
->
getType
(),
$teasers_to_preprocess
))
{
// The UW service object.
$uwService
=
\Drupal
::
service
(
'uw_cfg_common.uw_service'
);
// If on a teaser page get the variables for teaser.
if
(
$variables
[
'view_mode'
]
==
'teaser'
&&
in_array
(
$variables
[
'node'
]
->
getType
(),
$teasers_to_preprocess
))
{
$variables
[
'teaser'
]
=
$
uwService
->
uwG
etNodeContent
(
$variables
[
'node'
],
'teaser'
,
'all'
);
$variables
[
'teaser'
]
=
$
nodeContent
->
g
etNodeContent
(
$variables
[
'node'
],
'teaser'
,
'all'
,
$uwService
->
uwGetNodePreprocessing
(
'featured_image'
)
);
}
// If on a node page get the variables for now.
if
(
$variables
[
'view_mode'
]
==
'full'
&&
in_array
(
$variables
[
'node'
]
->
getType
(),
$nodes_to_preprocess
))
{
$variables
[
'node_data'
]
=
$
uwService
->
uwG
etNodeContent
(
$variables
[
'node'
],
'full'
,
'all'
);
$variables
[
'node_data'
]
=
$
nodeContent
->
g
etNodeContent
(
$variables
[
'node'
],
'full'
,
'all'
,
$uwService
->
uwGetNodePreprocessing
(
'featured_image'
)
);
$variables
[
'node_data'
][
'content'
]
=
$variables
[
'content'
];
$variables
[
'featured_image'
]
=
$uwService
->
uwCheckNodeForFeaturedImage
(
$variables
[
'node'
]);
}
...
...
@@ -489,6 +488,9 @@ function uw_fdsu_theme_resp_preprocess_container(&$variables) {
// The UW service object.
$uwService
=
\Drupal
::
service
(
'uw_cfg_common.uw_service'
);
// The UW node content service.
$uwNodeContent
=
\Drupal
::
service
(
'uw_cfg_common.uw_node_content'
);
// The list of content types that will have header
// and footer in layout builder pages.
$content_types
=
$uwService
->
uwGetNodePreprocessing
(
'layout_container'
);
...
...
@@ -510,8 +512,8 @@ function uw_fdsu_theme_resp_preprocess_container(&$variables) {
// If there is a node object, get the header and footer data.
if
(
$node
)
{
$variables
[
'header_data'
]
=
$uw
Service
->
uwG
etNodeContent
(
$node
,
'teaser'
,
'header'
);
$variables
[
'footer_data'
]
=
$uw
Service
->
uwG
etNodeContent
(
$node
,
'teaser'
,
'footer'
);
$variables
[
'header_data'
]
=
$uw
NodeContent
->
g
etNodeContent
(
$node
,
'teaser'
,
'header'
,
$uwService
->
uwGetNodePreprocessing
(
'featured_image'
)
);
$variables
[
'footer_data'
]
=
$uw
NodeContent
->
g
etNodeContent
(
$node
,
'teaser'
,
'footer'
,
$uwService
->
uwGetNodePreprocessing
(
'featured_image'
)
);
}
}
}
...
...
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