diff --git a/src/transformers/Utils/Plugins/EntityReferenceFieldField.php b/src/transformers/Utils/Plugins/EntityReferenceFieldField.php index efe1e34..eed2baa 100644 --- a/src/transformers/Utils/Plugins/EntityReferenceFieldField.php +++ b/src/transformers/Utils/Plugins/EntityReferenceFieldField.php @@ -54,13 +54,19 @@ protected function getTemplateOverrideData() case 'media': if ($bundles) { $data['settings']['handler_settings']['target_bundles'] = $bundles; - $data['settings']['handler_settings']['sort']['field'] = $this->getFieldName().'.title'; foreach ($bundles as $bundle) { $data['dependencies']['config'][] = 'media.type.'.$bundle; } } break; - + case 'block': + if ($bundles) { + $data['settings']['handler_settings']['target_bundles'] = $bundles; + foreach ($bundles as $bundle) { + $data['dependencies']['config'][] = 'block_content.type.' . $bundle; + } + } + break; case 'paragraphs': if ($bundles) { $data['settings']['handler_settings']['target_bundles'] = $bundles; diff --git a/src/transformers/Utils/templates/field/entity_reference/block/field.yml b/src/transformers/Utils/templates/field/entity_reference/block/field.yml new file mode 100644 index 0000000..fad3454 --- /dev/null +++ b/src/transformers/Utils/templates/field/entity_reference/block/field.yml @@ -0,0 +1,26 @@ +uuid: d1cc117e-06cc-4c13-81eb-11497ac9eb44 +langcode: en +status: true +dependencies: + config: + module: + - entity_reference +id: block_content.textarea.field_key_facts +field_name: field_key_facts +entity_type: block_content +bundle: textarea +label: 'Key Facts' +description: '' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: + handler: 'default:block_content' + handler_settings: + target_bundles: + sort: + field: _none + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/src/transformers/Utils/templates/field/entity_reference/block/form.yml b/src/transformers/Utils/templates/field/entity_reference/block/form.yml new file mode 100644 index 0000000..54152e9 --- /dev/null +++ b/src/transformers/Utils/templates/field/entity_reference/block/form.yml @@ -0,0 +1,23 @@ +dependencies: + default: + module: +content: + default: + weight: 2 + settings: + form_mode: default + revision: true + label_singular: '' + label_plural: '' + collapsible: false + collapsed: false + allow_new: true + match_operator: CONTAINS + allow_duplicate: false + override_labels: false + allow_existing: false + third_party_settings: + entity_browser_entity_form: + entity_browser_id: _none + type: inline_entity_form_complex + region: content \ No newline at end of file diff --git a/src/transformers/Utils/templates/field/entity_reference/block/storage.yml b/src/transformers/Utils/templates/field/entity_reference/block/storage.yml new file mode 100644 index 0000000..261a71b --- /dev/null +++ b/src/transformers/Utils/templates/field/entity_reference/block/storage.yml @@ -0,0 +1,19 @@ +uuid: 6531995d-7896-45f8-806d-ffdd90b41b8d +langcode: en +status: true +dependencies: + module: + - block_content +id: block_content.field_key_facts +field_name: field_key_facts +entity_type: block_content +type: entity_reference +settings: + target_type: block_content +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/src/transformers/Utils/templates/field/entity_reference/block/view.yml b/src/transformers/Utils/templates/field/entity_reference/block/view.yml new file mode 100644 index 0000000..a26bc5a --- /dev/null +++ b/src/transformers/Utils/templates/field/entity_reference/block/view.yml @@ -0,0 +1,10 @@ +content: + default: + weight: 2 + label: hidden + __|settings: + view_mode: default + link: false + __|third_party_settings: { } + type: entity_reference_entity_view + region: content \ No newline at end of file diff --git a/src/transformers/Utils/templates/field/entity_reference/group/field.yml b/src/transformers/Utils/templates/field/entity_reference/group/field.yml new file mode 100644 index 0000000..4584308 --- /dev/null +++ b/src/transformers/Utils/templates/field/entity_reference/group/field.yml @@ -0,0 +1,23 @@ +uuid: e8664aa0-a5c0-4804-8ee1-6132f175942d +langcode: en +status: true +dependencies: +id: block_content.anchor.field_ref_content +field_name: field_ref_content +entity_type: block_content +bundle: anchor +label: 'Ref Content' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:group' + handler_settings: + sort: + field: badge_name + direction: ASC + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/src/transformers/Utils/templates/field/entity_reference/group/form.yml b/src/transformers/Utils/templates/field/entity_reference/group/form.yml new file mode 100644 index 0000000..26a4907 --- /dev/null +++ b/src/transformers/Utils/templates/field/entity_reference/group/form.yml @@ -0,0 +1,11 @@ +content: + default: + weight: 27 + __|settings: + match_operator: CONTAINS + match_limit: 10 + size: 60 + placeholder: '' + __|third_party_settings: { } + type: entity_reference_autocomplete + region: content diff --git a/src/transformers/Utils/templates/field/entity_reference/group/storage.yml b/src/transformers/Utils/templates/field/entity_reference/group/storage.yml new file mode 100644 index 0000000..562f58d --- /dev/null +++ b/src/transformers/Utils/templates/field/entity_reference/group/storage.yml @@ -0,0 +1,19 @@ +uuid: b6768c60-7e4e-43a1-9853-0c45029331f6 +langcode: en +status: true +dependencies: + module: + - group +id: block_content.field_ref_content +field_name: field_ref_content +entity_type: block_content +type: entity_reference +settings: + target_type: group +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/src/transformers/Utils/templates/field/entity_reference/group/view.yml b/src/transformers/Utils/templates/field/entity_reference/group/view.yml new file mode 100644 index 0000000..af87c79 --- /dev/null +++ b/src/transformers/Utils/templates/field/entity_reference/group/view.yml @@ -0,0 +1,10 @@ +content: + default: + weight: 1 + label: hidden + settings: + view_mode: teaser + link: false + third_party_settings: { } + type: entity_reference_entity_view + region: content diff --git a/src/transformers/Utils/templates/field/entity_reference/media/field.yml b/src/transformers/Utils/templates/field/entity_reference/media/field.yml index f87ece6..1ad6d2d 100644 --- a/src/transformers/Utils/templates/field/entity_reference/media/field.yml +++ b/src/transformers/Utils/templates/field/entity_reference/media/field.yml @@ -15,8 +15,9 @@ default_value_callback: '' settings: handler: 'default:media' handler_settings: + target_bundles: sort: - field: title + field: _none direction: ASC auto_create: false auto_create_bundle: '' diff --git a/src/transformers/Utils/templates/field/radios/view.yml b/src/transformers/Utils/templates/field/radios/view.yml index 2e0feb7..ff2b802 100644 --- a/src/transformers/Utils/templates/field/radios/view.yml +++ b/src/transformers/Utils/templates/field/radios/view.yml @@ -1,4 +1,13 @@ +dependencies: + default: + module: + - link + - options + content: default: label: hidden region: content + type: list_default + __|settings: { } + __|third_party_settings: { } diff --git a/src/transformers/Utils/templates/field/rich_text/view.yml b/src/transformers/Utils/templates/field/rich_text/view.yml index 2e0feb7..9c2fbb0 100644 --- a/src/transformers/Utils/templates/field/rich_text/view.yml +++ b/src/transformers/Utils/templates/field/rich_text/view.yml @@ -1,4 +1,11 @@ +dependencies: + default: + module: + - text content: default: label: hidden region: content + type: text_default + __|settings: { } + __|third_party_settings: { } diff --git a/src/transformers/Utils/templates/field/select/view.yml b/src/transformers/Utils/templates/field/select/view.yml index 2e0feb7..ff2b802 100644 --- a/src/transformers/Utils/templates/field/select/view.yml +++ b/src/transformers/Utils/templates/field/select/view.yml @@ -1,4 +1,13 @@ +dependencies: + default: + module: + - link + - options + content: default: label: hidden region: content + type: list_default + __|settings: { } + __|third_party_settings: { } diff --git a/src/transformers/Utils/templates/field/string/view.yml b/src/transformers/Utils/templates/field/string/view.yml index 985b82d..98ef470 100644 --- a/src/transformers/Utils/templates/field/string/view.yml +++ b/src/transformers/Utils/templates/field/string/view.yml @@ -1,3 +1,7 @@ +dependencies: + default: + module: + - text content: default: weight: 0 diff --git a/src/transformers/Utils/templates/field/string_long/field.yml b/src/transformers/Utils/templates/field/string_long/field.yml old mode 100644 new mode 100755 index b8ae2d0..31e7f7b --- a/src/transformers/Utils/templates/field/string_long/field.yml +++ b/src/transformers/Utils/templates/field/string_long/field.yml @@ -7,11 +7,11 @@ id: node.test_node.field_string_example field_name: field_string_example entity_type: node bundle: test_node -label: string_example +label: Copy description: '' required: false translatable: false default_value: { } default_value_callback: '' __|settings: { } -field_type: string +field_type: string_long diff --git a/src/transformers/Utils/templates/field/string_long/view.yml b/src/transformers/Utils/templates/field/string_long/view.yml old mode 100644 new mode 100755 index 985b82d..db16010 --- a/src/transformers/Utils/templates/field/string_long/view.yml +++ b/src/transformers/Utils/templates/field/string_long/view.yml @@ -1,3 +1,7 @@ +dependencies: + default: + module: + - text content: default: weight: 0 @@ -5,5 +9,5 @@ content: __|settings: link_to_entity: false __|third_party_settings: { } - type: string + type: basic_string region: content diff --git a/src/transformers/Utils/templates/field/text/view.yml b/src/transformers/Utils/templates/field/text/view.yml index fafbd79..5090b24 100644 --- a/src/transformers/Utils/templates/field/text/view.yml +++ b/src/transformers/Utils/templates/field/text/view.yml @@ -1,3 +1,7 @@ +dependencies: + default: + module: + - text content: default: weight: 0 diff --git a/src/transformers/Utils/templates/field/text_long/form.yml b/src/transformers/Utils/templates/field/text_long/form.yml index 2c46097..b86809d 100644 --- a/src/transformers/Utils/templates/field/text_long/form.yml +++ b/src/transformers/Utils/templates/field/text_long/form.yml @@ -5,5 +5,5 @@ content: size: 60 placeholder: '' __|third_party_settings: { } - type: text_textfield + type: text_textarea region: content diff --git a/src/transformers/Utils/templates/field/text_long/view.yml b/src/transformers/Utils/templates/field/text_long/view.yml index fafbd79..5090b24 100644 --- a/src/transformers/Utils/templates/field/text_long/view.yml +++ b/src/transformers/Utils/templates/field/text_long/view.yml @@ -1,3 +1,7 @@ +dependencies: + default: + module: + - text content: default: weight: 0