Oliver Davies
6d9ecd8df0
Rather than the custom event sorting plugin being based on the `created` value, this change adds a new `field_event_date` field to the talk node type and uses this for the sorting instead. This commit also adds a new `TalkDateUpdater` service that extracts either the next event date if there is a future date, or the last past event date if there is no future date, from `field_events` for each talk and saves it into the event date field. For consistency, and to ensure that the results are ordered correctly, the talk date updater converts the date from a date string (e.g. `2020-08-24`) into a UNIX timestamp, and the timestamp is saved in the event date field. This can be changed at a later date if needed. The talks view has been updated to use the updated sort plugin, and the existing tests have been updated to use the new field. References #204
41 lines
897 B
YAML
41 lines
897 B
YAML
uuid: a4c102d8-1359-4d9e-90ff-2a92dd35c196
|
|
langcode: en
|
|
status: true
|
|
dependencies:
|
|
config:
|
|
- core.entity_view_mode.node.teaser
|
|
- field.field.node.talk.body
|
|
- field.field.node.talk.field_event_date
|
|
- field.field.node.talk.field_events
|
|
- field.field.node.talk.field_excerpt
|
|
- field.field.node.talk.field_slides
|
|
- field.field.node.talk.field_type
|
|
- field.field.node.talk.field_video
|
|
- node.type.talk
|
|
module:
|
|
- user
|
|
id: node.talk.teaser
|
|
targetEntityType: node
|
|
bundle: talk
|
|
mode: teaser
|
|
content:
|
|
field_excerpt:
|
|
type: basic_string
|
|
weight: 0
|
|
region: content
|
|
label: hidden
|
|
settings: { }
|
|
third_party_settings: { }
|
|
links:
|
|
weight: 1
|
|
region: content
|
|
settings: { }
|
|
third_party_settings: { }
|
|
hidden:
|
|
body: true
|
|
field_event_date: true
|
|
field_events: true
|
|
field_slides: true
|
|
field_type: true
|
|
field_video: true
|