added ref link to notes

This commit is contained in:
2021-11-16 17:00:46 +01:00
parent 191fb423c7
commit 83c3c0443d
5 changed files with 59 additions and 0 deletions
@@ -5,6 +5,7 @@ dependencies:
config:
- field.field.paragraph.note.field_note
- field.field.paragraph.note.field_numero
- field.field.paragraph.note.field_text_lien
- paragraphs.paragraphs_type.note
module:
- text
@@ -28,6 +29,16 @@ content:
third_party_settings: { }
type: number
region: content
field_text_lien:
weight: 2
settings:
match_operator: CONTAINS
match_limit: 10
size: 60
placeholder: ''
third_party_settings: { }
type: entity_reference_autocomplete
region: content
hidden:
created: true
status: true
@@ -5,6 +5,7 @@ dependencies:
config:
- field.field.paragraph.note.field_note
- field.field.paragraph.note.field_numero
- field.field.paragraph.note.field_text_lien
- paragraphs.paragraphs_type.note
module:
- text
@@ -29,5 +30,13 @@ content:
third_party_settings: { }
type: number_integer
region: content
field_text_lien:
weight: 2
label: above
settings:
link: true
third_party_settings: { }
type: entity_reference_label
region: content
hidden:
search_api_excerpt: true
@@ -0,0 +1,31 @@
uuid: 5504d452-d5bf-480c-aeab-f73bf81d7db9
langcode: fr
status: true
dependencies:
config:
- field.storage.paragraph.field_text_lien
- node.type.texte
- node.type.texte_prod
- paragraphs.paragraphs_type.note
id: paragraph.note.field_text_lien
field_name: field_text_lien
entity_type: paragraph
bundle: note
label: 'Text lien'
description: ''
required: false
translatable: true
default_value: { }
default_value_callback: ''
settings:
handler: 'default:node'
handler_settings:
target_bundles:
texte: texte
texte_prod: texte_prod
sort:
field: _none
direction: ASC
auto_create: false
auto_create_bundle: texte
field_type: entity_reference
@@ -115,6 +115,8 @@ interface NoteInterface {
type Noteref implements NoteInterface {
note: String
numero: Int
#
liens: [TextInterface]
}
type Noteprod implements NoteInterface {
@@ -584,6 +584,12 @@ class EnFrSchemaExtension extends SdlSchemaExtensionPluginBase {
->map('value', $builder->fromParent())
->map('path', $builder->fromValue('field_numero.value'))
);
$registry->addFieldResolver('Noteprod', 'liens',
$builder->produce('entity_reference')
->map('entity', $builder->fromParent())
->map('field', $builder->fromValue('field_text_lien'))
);
}
protected function addNoteProd(ResolverRegistryInterface $registry, ResolverBuilder $builder) {