Commit d1dce601 authored by Chris Shantz's avatar Chris Shantz
Browse files

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

parents 4d96de17 f2309c10
index: true
priority: '0.5'
changefreq: monthly
include_images: false
......@@ -706,12 +706,10 @@ display:
type: default
options: { }
row:
type: fields
type: 'entity:node'
options:
default_field_elements: false
inline: { }
separator: ''
hide_empty: false
relationship: none
view_mode: teaser
fields:
field_uw_event_date:
id: field_uw_event_date
......@@ -1096,12 +1094,10 @@ display:
type: default
options: { }
row:
type: fields
type: 'entity:node'
options:
default_field_elements: false
inline: { }
separator: ''
hide_empty: false
relationship: none
view_mode: teaser
fields:
field_uw_event_date:
id: field_uw_event_date
......
......@@ -35,6 +35,7 @@ dependencies:
- 'drupal:user'
- 'drupal:views'
- 'drupal:views_autocomplete_filters'
- 'simple_sitemap:simple_sitemap'
- 'term_reference_tree:term_reference_tree'
- 'uw_cfg_common:uw_cfg_common'
- 'uw_media:uw_media'
......@@ -91,7 +91,7 @@ function uw_ct_event_views_pre_render(ViewExecutable $view) {
// Remove exposed filters on block listing view.
if ($view->id() == 'uw_view_events' &&
$view->getTitle() == 'Event listing') {
unset($view->exposed_widgets);
$view->exposed_widgets = NULL;
}
}
......@@ -111,29 +111,35 @@ function uw_ct_event_geofield_map_latlon_element_alter(array &$map_settings, arr
function uw_ct_event_preprocess_views_view_unformatted(&$variables) {
// If on an events view, then set the dates.
if ($variables['view']->id() == 'uw_view_events') {
if (
$variables['view']->id() == 'uw_view_events' &&
$variables['view']->getDisplay()->display['id'] == 'event_page'
) {
$uwService = \Drupal::service('uw_cfg_common.uw_service');
$uwNodeContent = \Drupal::service('uw_cfg_common.uw_node_content');
// For each row, get the data out and the node data.
foreach ($variables['rows'] as $row) {
// Load the node.
$node = Node::load($row['content']['#row']->nid);
$node = Node::load($row['content']['#node']->nid->value);
// Get the node data.
$node_data = $uwService->uwGetNodeContent($node, 'teaser');
$node_data = $uwNodeContent->getNodeContent($node, 'teaser', 'all');
// Get the date info.
$date['value'] = $row['content']['#row']->node__field_uw_event_date_field_uw_event_date_value;
$date['end_value'] = $row['content']['#row']->node__field_uw_event_date_field_uw_event_date_end_value;
$date['duration'] = $row['content']['#row']->node__field_uw_event_date_field_uw_event_date_duration;
$date['value'] = $row['content']['#node']->node__field_uw_event_date_field_uw_event_date_value;
$date['end_value'] = $row['content']['#node']->node__field_uw_event_date_field_uw_event_date_end_value;
$date['duration'] = $row['content']['#node']->node__field_uw_event_date_field_uw_event_date_duration;
// Set the date on the node data.
$node_data['date'] = [$uwService->uwGetDate($date, 'event')];
$node_data['date'] = [$uwNodeContent->getDate($date, 'event')];
// Set a variable for the node data.
$variables['node_data'][] = $node_data;
// Set the type to teaser so that things display properly.
$variables['type'] = 'teaser';
}
}
}
......
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