Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
WCMS
uw_fdsu_theme_resp
Commits
b629ebc2
Commit
b629ebc2
authored
Nov 09, 2021
by
Eric Bremner
Browse files
ISTWCMS-5195: updating .theme to use new services for getting out node data
parent
02456945
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
uw_fdsu_theme_resp.theme
uw_fdsu_theme_resp.theme
+9
-7
No files found.
uw_fdsu_theme_resp.theme
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'
)
);
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment