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

ISTWCMS-4704: preprocess node moving to theme

parent b9d04f4f
......@@ -27,34 +27,3 @@ function uw_ct_event_geofield_map_latlon_element_alter(array &$map_settings, arr
$complete_form['#attached']['library'][] = 'uw_ct_event/uw_ct_event_edit';
}
}
/**
* Implements hook_preprocess_node().
*
* Set variables for teaser.
*/
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') {
// The UW service object.
$uwService = \Drupal::service('uw_cfg_common.uw_service');
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.
unset($variables['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