From a130168765cf3282dc76bca3ada9bff3d7735d6a Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sun, 10 May 2020 19:58:27 +0100 Subject: [PATCH] Add series field to blog posts --- ....entity_form_display.node.post.default.yml | 11 +++++++ ....entity_view_display.node.post.default.yml | 9 ++++++ ...e.entity_view_display.node.post.teaser.yml | 2 ++ .../field.field.node.post.field_series.yml | 29 +++++++++++++++++++ .../field.storage.node.field_series.yml | 20 +++++++++++++ 5 files changed, 71 insertions(+) create mode 100644 config/default/field.field.node.post.field_series.yml create mode 100644 config/default/field.storage.node.field_series.yml diff --git a/config/default/core.entity_form_display.node.post.default.yml b/config/default/core.entity_form_display.node.post.default.yml index 2bffbce..b555b45 100644 --- a/config/default/core.entity_form_display.node.post.default.yml +++ b/config/default/core.entity_form_display.node.post.default.yml @@ -5,6 +5,7 @@ dependencies: config: - field.field.node.post.body - field.field.node.post.field_excerpt + - field.field.node.post.field_series - field.field.node.post.field_tags - node.type.post module: @@ -39,6 +40,16 @@ content: third_party_settings: { } type: string_textarea region: content + field_series: + weight: 124 + settings: + match_operator: CONTAINS + match_limit: 10 + size: 60 + placeholder: '' + third_party_settings: { } + type: entity_reference_autocomplete + region: content field_tags: weight: 122 settings: diff --git a/config/default/core.entity_view_display.node.post.default.yml b/config/default/core.entity_view_display.node.post.default.yml index 88d79ed..169cada 100644 --- a/config/default/core.entity_view_display.node.post.default.yml +++ b/config/default/core.entity_view_display.node.post.default.yml @@ -5,6 +5,7 @@ dependencies: config: - field.field.node.post.body - field.field.node.post.field_excerpt + - field.field.node.post.field_series - field.field.node.post.field_tags - node.type.post module: @@ -29,6 +30,14 @@ content: third_party_settings: { } type: basic_string region: content + field_series: + weight: 104 + label: above + settings: + link: true + third_party_settings: { } + type: entity_reference_label + region: content field_tags: weight: 102 label: above diff --git a/config/default/core.entity_view_display.node.post.teaser.yml b/config/default/core.entity_view_display.node.post.teaser.yml index 53688cd..cd029a1 100644 --- a/config/default/core.entity_view_display.node.post.teaser.yml +++ b/config/default/core.entity_view_display.node.post.teaser.yml @@ -6,6 +6,7 @@ dependencies: - core.entity_view_mode.node.teaser - field.field.node.post.body - field.field.node.post.field_excerpt + - field.field.node.post.field_series - field.field.node.post.field_tags - node.type.post module: @@ -29,4 +30,5 @@ content: third_party_settings: { } hidden: body: true + field_series: true field_tags: true diff --git a/config/default/field.field.node.post.field_series.yml b/config/default/field.field.node.post.field_series.yml new file mode 100644 index 0000000..d481773 --- /dev/null +++ b/config/default/field.field.node.post.field_series.yml @@ -0,0 +1,29 @@ +uuid: 1f7182fd-848c-4e03-bb17-a8132c524451 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_series + - node.type.post + - taxonomy.vocabulary.blog_series +id: node.post.field_series +field_name: field_series +entity_type: node +bundle: post +label: Series +description: 'Is this post part of a series?' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:taxonomy_term' + handler_settings: + target_bundles: + blog_series: blog_series + sort: + field: name + direction: asc + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/config/default/field.storage.node.field_series.yml b/config/default/field.storage.node.field_series.yml new file mode 100644 index 0000000..9679953 --- /dev/null +++ b/config/default/field.storage.node.field_series.yml @@ -0,0 +1,20 @@ +uuid: 27708079-5d79-45ba-90f3-41c5303c2490 +langcode: en +status: true +dependencies: + module: + - node + - taxonomy +id: node.field_series +field_name: field_series +entity_type: node +type: entity_reference +settings: + target_type: taxonomy_term +module: core +locked: false +cardinality: -1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false