From 84ae398a91cb9caf4085444a780b0f5b8bc87939 Mon Sep 17 00:00:00 2001 From: Mohammed Nassar Date: Fri, 9 Aug 2019 08:26:59 +0000 Subject: [PATCH] Issue #65: Add (Columns layout) variant for (Content row) paragraph type. --- ...aragraph.oe_content_row.columns_layout.yml | 47 +++++++++++++++++++ ...splay.paragraph.oe_content_row.default.yml | 7 +++ ...ity_form_mode.paragraph.columns_layout.yml | 9 ++++ ...splay.paragraph.oe_content_row.default.yml | 9 ++++ ...ontent_row.field_oe_content_row_layout.yml | 20 ++++++++ ....paragraph.field_oe_content_row_layout.yml | 20 ++++++++ oe_paragraphs.info.yml | 6 +++ 7 files changed, 118 insertions(+) create mode 100644 config/install/core.entity_form_display.paragraph.oe_content_row.columns_layout.yml create mode 100644 config/install/core.entity_form_mode.paragraph.columns_layout.yml create mode 100644 config/install/field.field.paragraph.oe_content_row.field_oe_content_row_layout.yml create mode 100644 config/install/field.storage.paragraph.field_oe_content_row_layout.yml diff --git a/config/install/core.entity_form_display.paragraph.oe_content_row.columns_layout.yml b/config/install/core.entity_form_display.paragraph.oe_content_row.columns_layout.yml new file mode 100644 index 00000000..d25d56e5 --- /dev/null +++ b/config/install/core.entity_form_display.paragraph.oe_content_row.columns_layout.yml @@ -0,0 +1,47 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_form_mode.paragraph.columns_layout + - field.field.paragraph.oe_content_row.field_oe_content_row_layout + - field.field.paragraph.oe_content_row.field_oe_paragraphs + - field.field.paragraph.oe_content_row.field_oe_title + - paragraphs.paragraphs_type.oe_content_row + module: + - oe_paragraphs +id: paragraph.oe_content_row.columns_layout +targetEntityType: paragraph +bundle: oe_content_row +mode: columns_layout +content: + field_oe_content_row_layout: + type: options_select + weight: 0 + region: content + settings: { } + third_party_settings: { } + field_oe_paragraphs: + weight: 1 + settings: + title: Paragraph + title_plural: Paragraphs + edit_mode: closed + closed_mode: summary + autocollapse: none + closed_mode_threshold: 0 + add_mode: dropdown + form_display_mode: default + default_paragraph_type: _none + features: + duplicate: duplicate + collapse_edit_all: collapse_edit_all + add_above: '0' + third_party_settings: { } + type: oe_paragraphs_variants + region: content +hidden: + created: true + field_oe_title: true + status: true + translation: true + uid: true diff --git a/config/install/core.entity_form_display.paragraph.oe_content_row.default.yml b/config/install/core.entity_form_display.paragraph.oe_content_row.default.yml index 4dac2f15..746cc3ae 100644 --- a/config/install/core.entity_form_display.paragraph.oe_content_row.default.yml +++ b/config/install/core.entity_form_display.paragraph.oe_content_row.default.yml @@ -2,6 +2,7 @@ langcode: en status: true dependencies: config: + - field.field.paragraph.oe_content_row.field_oe_content_row_layout - field.field.paragraph.oe_content_row.field_oe_paragraphs - field.field.paragraph.oe_content_row.field_oe_title - paragraphs.paragraphs_type.oe_content_row @@ -12,6 +13,12 @@ targetEntityType: paragraph bundle: oe_content_row mode: default content: + field_oe_content_row_layout: + weight: 1 + settings: { } + third_party_settings: { } + type: options_select + region: content field_oe_paragraphs: weight: 0 settings: diff --git a/config/install/core.entity_form_mode.paragraph.columns_layout.yml b/config/install/core.entity_form_mode.paragraph.columns_layout.yml new file mode 100644 index 00000000..802495cd --- /dev/null +++ b/config/install/core.entity_form_mode.paragraph.columns_layout.yml @@ -0,0 +1,9 @@ +langcode: en +status: true +dependencies: + module: + - paragraphs +id: paragraph.columns_layout +label: 'Columns layout' +targetEntityType: paragraph +cache: true diff --git a/config/install/core.entity_view_display.paragraph.oe_content_row.default.yml b/config/install/core.entity_view_display.paragraph.oe_content_row.default.yml index 28fa2c5a..c88e3788 100644 --- a/config/install/core.entity_view_display.paragraph.oe_content_row.default.yml +++ b/config/install/core.entity_view_display.paragraph.oe_content_row.default.yml @@ -2,16 +2,25 @@ langcode: en status: true dependencies: config: + - field.field.paragraph.oe_content_row.field_oe_content_row_layout - field.field.paragraph.oe_content_row.field_oe_paragraphs - field.field.paragraph.oe_content_row.field_oe_title - paragraphs.paragraphs_type.oe_content_row module: - entity_reference_revisions + - options id: paragraph.oe_content_row.default targetEntityType: paragraph bundle: oe_content_row mode: default content: + field_oe_content_row_layout: + weight: 3 + label: above + settings: { } + third_party_settings: { } + type: list_default + region: content field_oe_paragraphs: weight: 2 label: above diff --git a/config/install/field.field.paragraph.oe_content_row.field_oe_content_row_layout.yml b/config/install/field.field.paragraph.oe_content_row.field_oe_content_row_layout.yml new file mode 100644 index 00000000..74adc126 --- /dev/null +++ b/config/install/field.field.paragraph.oe_content_row.field_oe_content_row_layout.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_oe_content_row_layout + - paragraphs.paragraphs_type.oe_content_row + module: + - options +id: paragraph.oe_content_row.field_oe_content_row_layout +field_name: field_oe_content_row_layout +entity_type: paragraph +bundle: oe_content_row +label: Layout +description: 'Column layout for displaying content items. If none selected, the content will be displayed in one column.' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: list_string diff --git a/config/install/field.storage.paragraph.field_oe_content_row_layout.yml b/config/install/field.storage.paragraph.field_oe_content_row_layout.yml new file mode 100644 index 00000000..51c20ad6 --- /dev/null +++ b/config/install/field.storage.paragraph.field_oe_content_row_layout.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - options + - paragraphs +id: paragraph.field_oe_content_row_layout +field_name: field_oe_content_row_layout +entity_type: paragraph +type: list_string +settings: + allowed_values: { } + allowed_values_function: '' +module: options +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/oe_paragraphs.info.yml b/oe_paragraphs.info.yml index 3e3e48ef..9d26c446 100644 --- a/oe_paragraphs.info.yml +++ b/oe_paragraphs.info.yml @@ -17,6 +17,7 @@ dependencies: config_devel: install: # Form modes. + - core.entity_form_mode.paragraph.columns_layout - core.entity_form_mode.paragraph.date - core.entity_form_mode.paragraph.highlight - core.entity_form_mode.paragraph.inpage_navigation @@ -87,11 +88,13 @@ config_devel: - paragraphs.paragraphs_type.oe_list_item_block # Content row + - core.entity_form_display.paragraph.oe_content_row.columns_layout - core.entity_form_display.paragraph.oe_content_row.default - core.entity_form_display.paragraph.oe_content_row.inpage_navigation - core.entity_view_display.paragraph.oe_content_row.default - field.field.paragraph.oe_content_row.field_oe_paragraphs - field.field.paragraph.oe_content_row.field_oe_title + - field.field.paragraph.oe_content_row.field_oe_content_row_layout - paragraphs.paragraphs_type.oe_content_row # Field types already included @@ -130,6 +133,9 @@ config_devel: # List item block layout - field.storage.paragraph.field_oe_list_item_block_layout + # Content row layout + - field.storage.paragraph.field_oe_content_row_layout + optional: # Paragraph multilingual configuration - language.content_settings.paragraph.oe_accordion