Commit e4494bfd authored by Eric Bremner's avatar Eric Bremner
Browse files

ISTWCMS-4704: updating preprocess node to handle full node view

parent d8bcf1d2
......@@ -37,13 +37,21 @@ function uw_ct_event_preprocess_node(&$variables) {
// If we are on a event node that is a teaser,
// get out the variables to be used in pattern-lab.
if ($variables['node']->getType() == 'uw_ct_event' && $variables['view_mode'] == 'teaser') {
if ($variables['node']->getType() == 'uw_ct_event') {
// The UW service object.
$uwService = \Drupal::service('uw_cfg_common.uw_service');
// Get the teaser variables.
$variables['teaser'] = $uwService->uwGetNodeContent($variables['node'], 'teaser', 'all');
if ($variables['view_mode'] == 'teaser') {
// Get the teaser variables.
$variables['teaser'] = $uwService->uwGetNodeContent($variables['node'], 'teaser', 'all');
}
if ($variables['view_mode'] == 'full') {
$variables['node_data'] = $uwService->uwGetNodeContent($variables['node'], 'full', 'all');
$variables['node_data']['content'] = $variables['content'];
}
// Unset the content variable, so that we do not get
// a second print of all the content.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment