Commit 7e6b9dfb authored by Liam Morland's avatar Liam Morland
Browse files

Merge branch '1.0.x' into 'prod/1.0.x'

Tag 1.0.1

See merge request !17
parents 07fe970d e22977d8
......@@ -27,3 +27,26 @@ 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' && $variables['view_mode'] == 'teaser') {
// The UW service object.
$uwService = \Drupal::service('uw_cfg_common.uw_service');
// Get the teaser variables.
$variables['teaser'] = $uwService->uwGetNodeContent($variables['node'], 'teaser', 'all');
// 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