field_images on creation #1270

This commit is contained in:
2021-06-30 10:42:45 +02:00
parent 50bf022a06
commit 3808a29e2f
6 changed files with 91 additions and 0 deletions
@@ -6,13 +6,16 @@ dependencies:
- field.field.node.creation.body
- field.field.node.creation.field_auteurs
- field.field.node.creation.field_date
- field.field.node.creation.field_images
- field.field.node.creation.field_oeuvre
- field.field.node.creation.field_rebonds
- field.field.node.creation.field_texte_de_depart
- image.style.thumbnail
- node.type.creation
module:
- datetime
- field_group
- image
- link
- text
third_party_settings:
@@ -51,6 +54,7 @@ third_party_settings:
group_tabs:
children:
- group_principal
- group_images
- group_lien
parent_name: ''
weight: 20
@@ -78,6 +82,20 @@ third_party_settings:
formatter: open
required_fields: true
label: Principal
group_images:
children:
- field_images
parent_name: group_tabs
weight: 20
format_type: tab
region: content
format_settings:
id: ''
classes: ''
description: ''
formatter: closed
required_fields: true
label: Images
id: node.creation.default
targetEntityType: node
bundle: creation
@@ -109,6 +127,14 @@ content:
third_party_settings: { }
type: datetime_default
region: content
field_images:
weight: 31
settings:
progress_indicator: throbber
preview_image_style: thumbnail
third_party_settings: { }
type: image_image
region: content
field_oeuvre:
weight: 1
settings:
@@ -6,12 +6,14 @@ dependencies:
- field.field.node.creation.body
- field.field.node.creation.field_auteurs
- field.field.node.creation.field_date
- field.field.node.creation.field_images
- field.field.node.creation.field_oeuvre
- field.field.node.creation.field_rebonds
- field.field.node.creation.field_texte_de_depart
- node.type.creation
module:
- datetime
- image
- link
- text
- user
@@ -44,6 +46,15 @@ content:
third_party_settings: { }
type: datetime_default
region: content
field_images:
weight: 108
label: above
settings:
image_style: ''
image_link: ''
third_party_settings: { }
type: image
region: content
field_oeuvre:
weight: 103
label: above
@@ -7,6 +7,7 @@ dependencies:
- field.field.node.creation.body
- field.field.node.creation.field_auteurs
- field.field.node.creation.field_date
- field.field.node.creation.field_images
- field.field.node.creation.field_oeuvre
- field.field.node.creation.field_rebonds
- field.field.node.creation.field_texte_de_depart
@@ -35,6 +36,7 @@ content:
hidden:
field_auteurs: true
field_date: true
field_images: true
field_oeuvre: true
field_rebonds: true
field_texte_de_depart: true
@@ -0,0 +1,45 @@
uuid: ed77ee8b-8825-445f-ad74-5d5ddcd5a60e
langcode: fr
status: true
dependencies:
config:
- field.storage.node.field_images
- node.type.creation
module:
- content_translation
- image
third_party_settings:
content_translation:
translation_sync:
alt: alt
file: '0'
title: '0'
id: node.creation.field_images
field_name: field_images
entity_type: node
bundle: creation
label: Images
description: ''
required: false
translatable: true
default_value: { }
default_value_callback: ''
settings:
file_directory: '[date:custom:Y]-[date:custom:m]'
file_extensions: 'png gif jpg jpeg'
max_filesize: ''
max_resolution: ''
min_resolution: ''
alt_field: true
alt_field_required: false
title_field: false
title_field_required: false
default_image:
uuid: ''
alt: ''
title: ''
width: null
height: null
handler: 'default:file'
handler_settings: { }
field_type: image
@@ -89,6 +89,7 @@ type Creation implements NodeInterface & MapItemInterface {
date: Date # field_date
rebonds: [Creation] # field_rebonds
texte_de_depart: [Textref] # field_texte_de_depart
images: [Image]
}
type Static implements NodeInterface {
@@ -650,6 +650,12 @@ class EnFrSchemaExtension extends SdlSchemaExtensionPluginBase {
->map('entity', $builder->fromParent())
));
$registry->addFieldResolver('Creation', 'images',
$builder->produce('entity_reference')
->map('entity', $builder->fromParent())
->map('field', $builder->fromValue('field_images'))
);
$registry->addFieldResolver('Creation', 'auteurs',
$builder->produce('entity_reference')
->map('entity', $builder->fromParent())