oliverdavies.uk-drupal-old/config/default/core.entity_form_display.node.talk.default.yml
Oliver Davies 6d9ecd8df0 Fix the ordering for future talks
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
2020-08-24 02:32:45 +01:00

149 lines
3.1 KiB
YAML

uuid: f99d1b17-736c-4f8d-8711-1f0d69602470
langcode: en
status: true
dependencies:
config:
- 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:
- paragraphs
- path
- scheduler
- speakerdeck_field
- text
id: node.talk.default
targetEntityType: node
bundle: talk
mode: default
content:
body:
type: text_textarea_with_summary
weight: 3
settings:
rows: 9
summary_rows: 3
placeholder: ''
show_summary: false
third_party_settings: { }
region: content
created:
type: datetime_timestamp
weight: 8
region: content
settings: { }
third_party_settings: { }
field_events:
type: entity_reference_paragraphs
weight: 4
settings:
title: Paragraph
title_plural: Paragraphs
edit_mode: closed
add_mode: dropdown
form_display_mode: default
default_paragraph_type: events
third_party_settings: { }
region: content
field_excerpt:
weight: 2
settings:
rows: 5
placeholder: ''
third_party_settings: { }
type: string_textarea
region: content
field_slides:
weight: 5
settings:
data_id: ''
data_ratio: ''
third_party_settings: { }
type: speakerdeck_widget
region: content
field_type:
weight: 1
settings: { }
third_party_settings: { }
type: options_select
region: content
field_video:
weight: 6
settings:
match_operator: CONTAINS
match_limit: 10
size: 60
placeholder: ''
third_party_settings: { }
type: entity_reference_autocomplete
region: content
path:
type: path
weight: 12
region: content
settings: { }
third_party_settings: { }
promote:
type: boolean_checkbox
settings:
display_label: true
weight: 9
region: content
third_party_settings: { }
publish_on:
type: datetime_timestamp_no_default
weight: 13
region: content
settings: { }
third_party_settings: { }
status:
type: boolean_checkbox
settings:
display_label: true
weight: 11
region: content
third_party_settings: { }
sticky:
type: boolean_checkbox
settings:
display_label: true
weight: 10
region: content
third_party_settings: { }
title:
type: string_textfield
weight: 0
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
uid:
type: entity_reference_autocomplete
weight: 7
settings:
match_operator: CONTAINS
size: 60
placeholder: ''
match_limit: 10
region: content
third_party_settings: { }
unpublish_on:
type: datetime_timestamp_no_default
weight: 14
region: content
settings: { }
third_party_settings: { }
url_redirects:
weight: 15
region: content
settings: { }
third_party_settings: { }
hidden:
field_event_date: true