Skip to content
Snippets Groups Projects
Commit 05c7a0be authored by Eric Bremner's avatar Eric Bremner Committed by Kevin Paxman
Browse files

ISTWCMS-4704: moving all the types of node preprocessing to the service, now...

ISTWCMS-4704: moving all the types of node preprocessing to the service, now no editing of the theme is required for nodes and teasers
parent 4ad9c49a
No related branches found
No related tags found
1 merge request!35ISTWCMS-4704: moving all the types of node preprocessing to the service, now...
......@@ -337,27 +337,14 @@ function _uw_fdsu_theme_resp_get_image_info(FileFieldItemList $field) {
*/
function uw_fdsu_theme_resp_preprocess_node(&$variables) {
// The UW service object.
$uwService = \Drupal::service('uw_cfg_common.uw_service');
// The types of nodes the need preprocessing.
$nodes_to_preprocess = [
'uw_ct_blog',
'uw_ct_event',
'uw_ct_news_item',
'uw_ct_web_page',
'uw_ct_catalog_item',
'uw_ct_contact',
'uw_ct_profile',
];
$nodes_to_preprocess = $uwService->uwGetNodePreprocessing('full');
// Teaser to be preprocessed.
$teasers_to_preprocess = [
'uw_ct_blog',
'uw_ct_event',
'uw_ct_news_item',
'uw_ct_web_page',
'uw_ct_catalog_item',
'uw_ct_contact',
'uw_ct_profile',
];
$teasers_to_preprocess = $uwService->uwGetNodePreprocessing('teaser');
// If there is a node that needs preprocessing,
// set the appropriate variables.
......@@ -481,15 +468,12 @@ function uw_fdsu_theme_resp_preprocess_container(&$variables) {
$variables['attributes']['class'][0] == 'layout-builder'
) {
// The UW service object.
$uwService = \Drupal::service('uw_cfg_common.uw_service');
// The list of content types that will have header
// and footer in layout builder pages.
$content_types = [
'uw_ct_blog',
'uw_ct_news_item',
'uw_ct_event',
'uw_ct_contact',
'uw_ct_profile',
];
$content_types = $uwService->uwGetNodePreprocessing('layout_container');
// Get the node object.
$node = \Drupal::routeMatch()->getParameter('node');
......@@ -499,9 +483,6 @@ function uw_fdsu_theme_resp_preprocess_container(&$variables) {
// get the header and footer.
if ($node && in_array($node->getType(), $content_types)) {
// The UW service object.
$uwService = \Drupal::service('uw_cfg_common.uw_service');
// Get the node object.
$node = \Drupal::routeMatch()->getParameter('node');
......
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