public
Last active

  • Download Gist
field.instance.default.yml
YAML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
# field.instance.node.article.body.yml
default_value:
-
summary: ''
value: "<p>default 1</p>\r\n"
format: basic_html
field_type: text_with_summary
-
summary: ''
value: "<p>default 2</p>\r\n"
format: basic_html
field_type: text_with_summary
 
# Field instance defintion holds the top 'sequence' part.
# field.schema.yml
field.instance.*.*.*:
type: mapping
label: 'Field instance'
mapping:
default_value:
type: sequence
label: 'Default value'
sequence:
- type: field.[field_type].value
 
# Just type specific elements in data type defintion
# text.scheam.yml
field.text_with_summary.value:
type: mapping
label: 'Default'
mapping:
summary:
type: string
label: 'Summary'
value:
type: text
label: 'Body'
format:
type: string
label: 'Text format'
field_type:
type: string
label: 'Field type'

This way, we can have field.instance...*

field.instance.*.*.*:
  type: mapping
  label: 'Field instance'
  mapping:
    default_value:
      type: sequence
      label: 'Default value'
      sequence:
        - type: field.[field_type].value

and data type as

field.text_with_summary.value:
  type: mapping
  label: 'Default'
  mapping:
    summary:
      type: string
      label: 'Summary'
    value:
      type: text
      label: 'Body'
    format:
      type: string
      label: 'Text format'
    field_type:
      type: string
      label: 'Field type'

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.