2

I've programmatically created a content-type with 3 fields (in D8).

The fields are created but do not show up on node creation. If I go to the content-type form display, the fields are there, but I need to save this page to get the fields to show up on node creation.

The content-type and fields are created in yml-files and the Looks like this:

config/install/field.field.node.slideshow_slide.slide_weight.yml

langcode: en
status: true
dependencies:
config:
    - field.storage.node.slide_weight
    - node.type.slideshow_slide
module:
    - text
enforced:
    module:
        - custom
id: node.slideshow_slide.slide_weight
field_name: slide_weight
entity_type: node
bundle: slideshow_slide
label: 'Weight'
description: 'This slides weight'
required: false
translatable: false
default_value: 0
default_value_callback: ''
settings: { }
field_type: string

config/install/core.entity_form_display.node.slideshow_slide.default.yml

langcode: en
status: true
dependencies:
config:
    - field.field.node.slideshow_slide.slide_image
    - field.field.node.slideshow_slide.slide_link
    - field.field.node.slideshow_slide.slide_weight
    - node.type.slideshow_slide
module:
    - image
    - link
id: node.slideshow_slide.default
targetEntityType: node
bundle: slideshow_slide
mode: default
content:
slide_image:
    label: visible
    weight: 101
    settings: {  }
    third_party_settings: {  }
slide_link:
    label: visible
    weight: 100
    settings: { }
    third_party_settings: {  }
slide_weight:
    label: visible
    weight: 100
    settings: { }
    third_party_settings: {  }
links:
    weight: 100
2

Found out that it needed "type" for all the fields in the form_display.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.