Use paragaphs for events

- Added drupal/paragraphs
- Added event paragraph type
- Added events field to the Talk and Workshop content types
This commit is contained in:
Oliver Davies 2020-02-07 22:53:44 +00:00
parent 522715d43b
commit 9b1cda6de8
26 changed files with 359 additions and 272 deletions

View file

@ -21,6 +21,7 @@
"drupal/core-project-message": "^8.8",
"drupal/core-recommended": "^8.8",
"drupal/markdown": "^1.3",
"drupal/paragraphs": "^1.10",
"drush/drush": "^10.2"
},
"require-dev": {

148
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "2d40a6c4acdc2b3f02d8c57729dbc4ec",
"content-hash": "4099c03d63a6ef65fd610d6716453d33",
"packages": [
{
"name": "asm89/stack-cors",
@ -2030,6 +2030,68 @@
"description": "Locked core dependencies; require this project INSTEAD OF drupal/core.",
"time": "2019-12-18T10:34:03+00:00"
},
{
"name": "drupal/entity_reference_revisions",
"version": "1.7.0",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/entity_reference_revisions.git",
"reference": "8.x-1.7"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/entity_reference_revisions-8.x-1.7.zip",
"reference": "8.x-1.7",
"shasum": "4e3b849b0d984cd3c0a4330c9aa4cb16bf1f79f6"
},
"require": {
"drupal/core": "~8.0"
},
"require-dev": {
"drupal/diff": "*"
},
"type": "drupal-module",
"extra": {
"branch-alias": {
"dev-1.x": "1.x-dev"
},
"drupal": {
"version": "8.x-1.7",
"datestamp": "1570284187",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
}
}
},
"notification-url": "https://packages.drupal.org/8/downloads",
"license": [
"GPL-2.0-or-later"
],
"authors": [
{
"name": "Berdir",
"homepage": "https://www.drupal.org/user/214652"
},
{
"name": "Frans",
"homepage": "https://www.drupal.org/user/514222"
},
{
"name": "jeroen.b",
"homepage": "https://www.drupal.org/user/1853532"
},
{
"name": "miro_dietiker",
"homepage": "https://www.drupal.org/user/227761"
}
],
"description": "Adds a Entity Reference field type with revision support.",
"homepage": "https://www.drupal.org/project/entity_reference_revisions",
"support": {
"source": "https://git.drupalcode.org/project/entity_reference_revisions"
}
},
{
"name": "drupal/markdown",
"version": "1.3.0",
@ -2088,6 +2150,90 @@
"issues": "https://www.drupal.org/project/markdown"
}
},
{
"name": "drupal/paragraphs",
"version": "1.10.0",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/paragraphs.git",
"reference": "8.x-1.10"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/paragraphs-8.x-1.10.zip",
"reference": "8.x-1.10",
"shasum": "12f96d90940df1c870bbe4cb97a8260169045911"
},
"require": {
"drupal/core": "~8",
"drupal/entity_reference_revisions": "~1.3"
},
"require-dev": {
"drupal/block_field": "~1.0",
"drupal/ctools": "3.x-dev",
"drupal/diff": "~1.0",
"drupal/entity_browser": "2.x-dev",
"drupal/entity_usage": "2.x-dev",
"drupal/field_group": "3.x-dev",
"drupal/inline_entity_form": "~1.0",
"drupal/paragraphs-paragraphs_library": "*",
"drupal/replicate": "~1.0",
"drupal/search_api": "~1.0",
"drupal/search_api_db": "*"
},
"suggest": {
"drupal/entity_browser": "Recommended for an improved user experience when using the Paragraphs library module"
},
"type": "drupal-module",
"extra": {
"branch-alias": {
"dev-1.x": "1.x-dev"
},
"drupal": {
"version": "8.x-1.10",
"datestamp": "1572617586",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
}
}
},
"notification-url": "https://packages.drupal.org/8/downloads",
"license": [
"GPL-2.0"
],
"authors": [
{
"name": "Berdir",
"homepage": "https://www.drupal.org/user/214652"
},
{
"name": "Frans",
"homepage": "https://www.drupal.org/user/514222"
},
{
"name": "Primsi",
"homepage": "https://www.drupal.org/user/282629"
},
{
"name": "jeroen.b",
"homepage": "https://www.drupal.org/user/1853532"
},
{
"name": "jstoller",
"homepage": "https://www.drupal.org/user/99012"
},
{
"name": "miro_dietiker",
"homepage": "https://www.drupal.org/user/227761"
}
],
"description": "Enables the creation of Paragraphs entities.",
"homepage": "https://www.drupal.org/project/paragraphs",
"support": {
"source": "https://git.drupalcode.org/project/paragraphs"
}
},
{
"name": "drush/drush",
"version": "10.2.0",

View file

@ -7,6 +7,7 @@ dependencies:
- field.field.node.talk.field_events
- node.type.talk
module:
- paragraphs
- text
id: node.talk.default
targetEntityType: node
@ -30,14 +31,16 @@ content:
settings: { }
third_party_settings: { }
field_events:
type: entity_reference_paragraphs
weight: 122
settings:
match_operator: CONTAINS
match_limit: 10
size: 60
placeholder: ''
title: Paragraph
title_plural: Paragraphs
edit_mode: closed
add_mode: dropdown
form_display_mode: default
default_paragraph_type: events
third_party_settings: { }
type: entity_reference_autocomplete
region: content
promote:
type: boolean_checkbox

View file

@ -7,6 +7,7 @@ dependencies:
- field.field.node.workshop.field_events
- node.type.workshop
module:
- paragraphs
- text
id: node.workshop.default
targetEntityType: node
@ -15,7 +16,7 @@ mode: default
content:
body:
type: text_textarea_with_summary
weight: 121
weight: 1
settings:
rows: 9
summary_rows: 3
@ -25,44 +26,46 @@ content:
region: content
created:
type: datetime_timestamp
weight: 10
weight: 5
region: content
settings: { }
third_party_settings: { }
field_events:
weight: 122
weight: 26
settings:
match_operator: CONTAINS
match_limit: 10
size: 60
placeholder: ''
title: Paragraph
title_plural: Paragraphs
edit_mode: open
add_mode: dropdown
form_display_mode: default
default_paragraph_type: event
third_party_settings: { }
type: entity_reference_autocomplete
type: entity_reference_paragraphs
region: content
promote:
type: boolean_checkbox
settings:
display_label: true
weight: 15
weight: 6
region: content
third_party_settings: { }
status:
type: boolean_checkbox
settings:
display_label: true
weight: 120
weight: 3
region: content
third_party_settings: { }
sticky:
type: boolean_checkbox
settings:
display_label: true
weight: 16
weight: 7
region: content
third_party_settings: { }
title:
type: string_textfield
weight: -5
weight: 0
region: content
settings:
size: 60
@ -70,7 +73,7 @@ content:
third_party_settings: { }
uid:
type: entity_reference_autocomplete
weight: 5
weight: 4
settings:
match_operator: CONTAINS
size: 60

View file

@ -0,0 +1,34 @@
uuid: 9305e00f-ee05-4141-b8d5-d4f194f7082c
langcode: en
status: true
dependencies:
config:
- field.field.paragraph.event.field_link
- field.field.paragraph.event.field_name
- paragraphs.paragraphs_type.event
module:
- link
id: paragraph.event.default
targetEntityType: paragraph
bundle: event
mode: default
content:
field_link:
weight: 1
settings:
placeholder_url: ''
placeholder_title: ''
third_party_settings: { }
type: link_default
region: content
field_name:
weight: 0
settings:
size: 60
placeholder: ''
third_party_settings: { }
type: string_textfield
region: content
hidden:
created: true
status: true

View file

@ -1,67 +0,0 @@
uuid: ea0c8dbe-16c4-438f-8fef-6bd2a8229c47
langcode: en
status: true
dependencies:
config:
- field.field.taxonomy_term.events.field_date
- field.field.taxonomy_term.events.field_link
- field.field.taxonomy_term.events.field_location
- taxonomy.vocabulary.events
module:
- datetime
- link
- text
id: taxonomy_term.events.default
targetEntityType: taxonomy_term
bundle: events
mode: default
content:
description:
type: text_textarea
weight: 0
region: content
settings:
placeholder: ''
rows: 5
third_party_settings: { }
field_date:
weight: 103
settings:
increment: 15
date_order: YMD
time_type: '24'
third_party_settings: { }
type: datetime_datelist
region: content
field_link:
weight: 102
settings:
placeholder_url: ''
placeholder_title: ''
third_party_settings: { }
type: link_default
region: content
field_location:
weight: 101
settings:
size: 60
placeholder: ''
third_party_settings: { }
type: string_textfield
region: content
name:
type: string_textfield
weight: -5
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
status:
type: boolean_checkbox
settings:
display_label: true
weight: 100
region: content
third_party_settings: { }
hidden: { }

View file

@ -7,6 +7,7 @@ dependencies:
- field.field.node.talk.field_events
- node.type.talk
module:
- entity_reference_revisions
- text
- user
id: node.talk.default
@ -22,12 +23,13 @@ content:
third_party_settings: { }
region: content
field_events:
type: entity_reference_revisions_entity_view
weight: 102
label: above
settings:
link: true
view_mode: default
link: ''
third_party_settings: { }
type: entity_reference_label
region: content
links:
weight: 100

View file

@ -7,6 +7,7 @@ dependencies:
- field.field.node.workshop.field_events
- node.type.workshop
module:
- entity_reference_revisions
- text
- user
id: node.workshop.default
@ -25,9 +26,10 @@ content:
weight: 102
label: above
settings:
link: true
view_mode: default
link: ''
third_party_settings: { }
type: entity_reference_label
type: entity_reference_revisions_entity_view
region: content
links:
weight: 100

View file

@ -0,0 +1,36 @@
uuid: 9382d377-3f8c-4c9d-8c60-98024c6a9a0a
langcode: en
status: true
dependencies:
config:
- field.field.paragraph.event.field_link
- field.field.paragraph.event.field_name
- paragraphs.paragraphs_type.event
module:
- link
id: paragraph.event.default
targetEntityType: paragraph
bundle: event
mode: default
content:
field_link:
weight: 1
label: above
settings:
trim_length: 80
url_only: false
url_plain: false
rel: ''
target: ''
third_party_settings: { }
type: link
region: content
field_name:
weight: 0
label: above
settings:
link_to_entity: false
third_party_settings: { }
type: string
region: content
hidden: { }

View file

@ -1,55 +0,0 @@
uuid: 12d46c8a-37f5-4787-a747-030d27d3ba47
langcode: en
status: true
dependencies:
config:
- field.field.taxonomy_term.events.field_date
- field.field.taxonomy_term.events.field_link
- field.field.taxonomy_term.events.field_location
- taxonomy.vocabulary.events
module:
- datetime
- link
- text
id: taxonomy_term.events.default
targetEntityType: taxonomy_term
bundle: events
mode: default
content:
description:
label: hidden
type: text_default
weight: 0
region: content
settings: { }
third_party_settings: { }
field_date:
weight: 3
label: above
settings:
format_type: medium
timezone_override: ''
third_party_settings: { }
type: datetime_default
region: content
field_link:
weight: 2
label: above
settings:
trim_length: 80
url_only: false
url_plain: false
rel: ''
target: ''
third_party_settings: { }
type: link
region: content
field_location:
weight: 1
label: above
settings:
link_to_entity: false
third_party_settings: { }
type: string
region: content
hidden: { }

View file

@ -0,0 +1,12 @@
uuid: 639e31da-deff-4287-9534-f6773d4ddeb5
langcode: en
status: true
dependencies:
module:
- paragraphs
_core:
default_config_hash: fAWHL-ZbCR4HOdE03GYzQfiMYfEvVhTWNBHWcU_pa18
id: paragraph.preview
label: Preview
targetEntityType: paragraph
cache: true

View file

@ -6,6 +6,7 @@ module:
datetime: 0
dblog: 0
dynamic_page_cache: 0
entity_reference_revisions: 0
field: 0
field_ui: 0
file: 0
@ -23,13 +24,14 @@ module:
user: 0
views_ui: 0
views: 10
paragraphs: 11
minimal: 1000
theme:
stark: 0
stable: 0
classy: 0
claro: 0
bartik: 0
seven: 0
claro: 0
profile: minimal
_core:
default_config_hash: R4IF-ClDHXxblLcG0L7MgsLvfBIMAvi_skumNFQwkDc

View file

@ -1,11 +1,13 @@
uuid: 9f28d632-7f6a-4a57-ae88-0b29a8e78b55
uuid: 0d6655a0-de25-47ef-9133-81c58bad41fa
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_events
- node.type.talk
- taxonomy.vocabulary.events
- paragraphs.paragraphs_type.event
module:
- entity_reference_revisions
id: node.talk.field_events
field_name: field_events
entity_type: node
@ -17,13 +19,13 @@ translatable: false
default_value: { }
default_value_callback: ''
settings:
handler: 'default:taxonomy_term'
handler: 'default:paragraph'
handler_settings:
negate: 0
target_bundles:
events: events
sort:
field: name
direction: asc
auto_create: false
auto_create_bundle: ''
field_type: entity_reference
event: event
target_bundles_drag_drop:
event:
enabled: true
weight: 2
field_type: entity_reference_revisions

View file

@ -1,11 +1,13 @@
uuid: ebe9ccf4-8c8a-412d-9ef1-67d31d71df2c
uuid: 2b760037-dad1-47ac-92b1-ae198d25a694
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_events
- node.type.workshop
- taxonomy.vocabulary.events
- paragraphs.paragraphs_type.event
module:
- entity_reference_revisions
id: node.workshop.field_events
field_name: field_events
entity_type: node
@ -17,13 +19,13 @@ translatable: true
default_value: { }
default_value_callback: ''
settings:
handler: 'default:taxonomy_term'
handler: 'default:paragraph'
handler_settings:
negate: 0
target_bundles:
events: events
sort:
field: name
direction: asc
auto_create: false
auto_create_bundle: ''
field_type: entity_reference
event: event
target_bundles_drag_drop:
event:
enabled: true
weight: 2
field_type: entity_reference_revisions

View file

@ -0,0 +1,23 @@
uuid: a5032ff0-59d8-423c-b3ca-1b7e9f28a15d
langcode: en
status: true
dependencies:
config:
- field.storage.paragraph.field_link
- paragraphs.paragraphs_type.event
module:
- link
id: paragraph.event.field_link
field_name: field_link
entity_type: paragraph
bundle: event
label: Link
description: 'A link to the event website, ideally to the talk or workshop page.'
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings:
link_type: 16
title: 0
field_type: link

View file

@ -0,0 +1,19 @@
uuid: 13429fc5-1661-4a63-9883-7b678fa527e4
langcode: en
status: true
dependencies:
config:
- field.storage.paragraph.field_name
- paragraphs.paragraphs_type.event
id: paragraph.event.field_name
field_name: field_name
entity_type: paragraph
bundle: event
label: 'Event name'
description: ''
required: true
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: string

View file

@ -1,21 +0,0 @@
uuid: 5c462523-52ec-4c16-97c6-c59d678e2d57
langcode: en
status: true
dependencies:
config:
- field.storage.taxonomy_term.field_date
- taxonomy.vocabulary.events
module:
- datetime
id: taxonomy_term.events.field_date
field_name: field_date
entity_type: taxonomy_term
bundle: events
label: Date
description: ''
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: datetime

View file

@ -1,23 +0,0 @@
uuid: 2b6b6113-3771-44b0-87b1-4066df5b8c62
langcode: en
status: true
dependencies:
config:
- field.storage.taxonomy_term.field_link
- taxonomy.vocabulary.events
module:
- link
id: taxonomy_term.events.field_link
field_name: field_link
entity_type: taxonomy_term
bundle: events
label: Link
description: 'A link to the event page.'
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings:
link_type: 16
title: 0
field_type: link

View file

@ -1,19 +0,0 @@
uuid: 72a78132-e824-4601-804e-fde87145e58a
langcode: en
status: true
dependencies:
config:
- field.storage.taxonomy_term.field_location
- taxonomy.vocabulary.events
id: taxonomy_term.events.field_location
field_name: field_location
entity_type: taxonomy_term
bundle: events
label: Location
description: 'The location of the event, e.g. <em>London, UK</em>.'
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: string

View file

@ -1,17 +1,18 @@
uuid: 47b3cb91-41bf-4e00-b88a-851ef3d88931
uuid: 2f73f4d1-951a-4796-9635-03e376339537
langcode: en
status: true
dependencies:
module:
- entity_reference_revisions
- node
- taxonomy
- paragraphs
id: node.field_events
field_name: field_events
entity_type: node
type: entity_reference
type: entity_reference_revisions
settings:
target_type: taxonomy_term
module: core
target_type: paragraph
module: entity_reference_revisions
locked: false
cardinality: -1
translatable: true

View file

@ -1,13 +1,13 @@
uuid: 8ed18ca4-39ff-4d5f-90b4-415521fbe6cb
uuid: 63566e18-2286-46ca-a181-f42121153cb3
langcode: en
status: true
dependencies:
module:
- link
- taxonomy
id: taxonomy_term.field_link
- paragraphs
id: paragraph.field_link
field_name: field_link
entity_type: taxonomy_term
entity_type: paragraph
type: link
settings: { }
module: link

View file

@ -1,12 +1,12 @@
uuid: 36b906a1-10ff-484f-81cd-5a67401e613d
uuid: b72d860b-256c-483d-a615-cf6e0ebc5a31
langcode: en
status: true
dependencies:
module:
- taxonomy
id: taxonomy_term.field_location
field_name: field_location
entity_type: taxonomy_term
- paragraphs
id: paragraph.field_name
field_name: field_name
entity_type: paragraph
type: string
settings:
max_length: 255

View file

@ -1,20 +0,0 @@
uuid: 49798879-020a-43df-a5a0-550a67f31a9c
langcode: en
status: true
dependencies:
module:
- datetime
- taxonomy
id: taxonomy_term.field_date
field_name: field_date
entity_type: taxonomy_term
type: datetime
settings:
datetime_type: date
module: datetime
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false

View file

@ -0,0 +1,9 @@
uuid: 45f289b3-2e05-4f81-a8ae-d0532088582c
langcode: en
status: true
dependencies: { }
id: event
label: Event
icon_uuid: null
description: ''
behavior_plugins: { }

View file

@ -0,0 +1,3 @@
show_unpublished: true
_core:
default_config_hash: 7eR0sk71Eol86r_A7BMqn5_46wzenh5J1O5vZRCGKv8

View file

@ -1,8 +0,0 @@
uuid: adbc94a3-30fa-4df1-995d-a0b070b8700e
langcode: en
status: true
dependencies: { }
name: Events
vid: events
description: 'Events that I''ve given talks and workshops at.'
weight: 0