Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/reference group #21

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
10 changes: 8 additions & 2 deletions src/transformers/Utils/Plugins/EntityReferenceFieldField.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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: ''
Expand Down
9 changes: 9 additions & 0 deletions src/transformers/Utils/templates/field/radios/view.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
dependencies:
default:
module:
- link
- options

content:
default:
label: hidden
region: content
type: list_default
__|settings: { }
__|third_party_settings: { }
7 changes: 7 additions & 0 deletions src/transformers/Utils/templates/field/rich_text/view.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
dependencies:
default:
module:
- text
content:
default:
label: hidden
region: content
type: text_default
__|settings: { }
__|third_party_settings: { }
9 changes: 9 additions & 0 deletions src/transformers/Utils/templates/field/select/view.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
dependencies:
default:
module:
- link
- options

content:
default:
label: hidden
region: content
type: list_default
__|settings: { }
__|third_party_settings: { }
4 changes: 4 additions & 0 deletions src/transformers/Utils/templates/field/string/view.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
dependencies:
default:
module:
- text
content:
default:
weight: 0
Expand Down
4 changes: 2 additions & 2 deletions src/transformers/Utils/templates/field/string_long/field.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 5 additions & 1 deletion src/transformers/Utils/templates/field/string_long/view.yml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
dependencies:
default:
module:
- text
content:
default:
weight: 0
label: hidden
__|settings:
link_to_entity: false
__|third_party_settings: { }
type: string
type: basic_string
region: content
4 changes: 4 additions & 0 deletions src/transformers/Utils/templates/field/text/view.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
dependencies:
default:
module:
- text
content:
default:
weight: 0
Expand Down
2 changes: 1 addition & 1 deletion src/transformers/Utils/templates/field/text_long/form.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ content:
size: 60
placeholder: ''
__|third_party_settings: { }
type: text_textfield
type: text_textarea
region: content
4 changes: 4 additions & 0 deletions src/transformers/Utils/templates/field/text_long/view.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
dependencies:
default:
module:
- text
content:
default:
weight: 0
Expand Down