This project is not covered by Drupal’s security advisory policy.

Are you a module developer and use config entities? Are you too lazy to write code for your config forms? Import your config entity schemas into config_pages by two lines!

$import = \Drupal::service('config_pages_import');
$import->import('config_entity_name');

Do you use more than one config entity and need something more smart?
List necessary config entities in your module info file:

config_pages:
  - config_entity_name_1
  - config_entity_name_2

and import them by module name:

$import = \Drupal::service('config_pages_import');
$import->importFromModule('module_name');

You are also able to import your config entities manually. Use the form on admin/structure/config_pages/config-pages-import page.

Schema example

# Config pages type tech name. Can contain only letters, numbers and underline.
config_pages_import_test:
  # Only mappings are supported
  type: mapping
  label: 'Config Pages Import Test'

  # Config Pages context
  context:
    # Show context info message on ConfigPage edit form
    show_warning: TRUE
    # Context groups
    group:
      language: TRUE

  # Config page menu item
  menu:
    path: '/admin/config_pages_import_test'
    weight: 0
    description: 'Config Pages Import Test'

  # Trird party settings, For example settings for "field_group" module. Optional.
  third_party_settings:
    # Only "form_display" is supported.
    form_display:
      field_group:
        group_details_test:
          children:
            - 'title'
            - 'description'
          parent_name: ''
          weight: 1
          format_type: 'details'
          format_settings:
            id: ''
            classes: ''
            open: TRUE
            required_fields: TRUE
          label: 'Details Test'
          region: 'content'

  mapping:

    # Field ID
    test_id:
      # Field plugin ID
      type: integer
      # Field label
      label: 'Test ID'

    title:
      type: string
      label: 'Title'
      # Value of the field. Optional. Contexts are not supported.
      value: 'Config Pages Import Test Page'

    description:
      type: string_long
      label: 'Description'
      # Number of values. Optional
      cardinality: 1
      # Help text. Optional
      description: 'Help Text'
      # Default value. Optional
      default_value: 'Default Value'
      value: 'This is description of the page'

    formated_description:
      type: text_with_summary
      label: 'Formated Description'
      # Required or not. Optional
      required: TRUE
      description: 'Help Text 2'
      # Default value may be an array, Optional
      default_value:
        value: 'Default Value 2'
        summary: 'Summary Default Text'
        format: 'full_html'
      # Field settings. Optional. Look at field plugin code to find more field settings.
      settings:
        display_summary: TRUE

    status:
      type: boolean
      label: 'Status'

    multiple_value:
      type: string
      label: 'Multiple Value'
      description: 'Multiple values and max length 24'
      # Unlimited number of values. Optional
      cardinality: -1
      # Max length. Only for strings. Optional
      max_length: 24
      # Default value may be a sequence. Optional
      default_value:
        - value: 'Multiple Default Value 1'
        - value: 'Multiple Default Value 2'

    field_with_form_display:
      type: string
      label: 'Field with different form display settings'
      # Form display parameters. Optional
      form_display:
        # Widget ID
        type: string_textfield
        # Weight of the field in the editor form. Optional
        weight: 3
        # Widget settings. Look at widget code to find more settings. Optional
        settings:
          size: 12
          placeholder: 'Placeholder Text'

    field_with_view_display:
      type: string
      label: 'Field with different view displays'
      view_display:
        # View mode. Optional. "default" view mode will be created even if you didn't describe it.
        full:
          # Field formatter ID
          type: string
          # Weight of the field in the view mode. Optional
          weight: 0
          # Label format. Optional
          label: hidden
          # Formatter settings. Look at formatter code to find more settings. Optional
          settings:
            link_to_entity: TRUE
Supporting organizations: 

Project information

  • caution Seeking new maintainer
    The current maintainers are looking for new people to take ownership.
  • Module categories: Import and Export
  • Ecosystem: Config Pages
  • Created by akerbel.dev on , updated
  • shield alertThis project is not covered by the security advisory policy.
    Use at your own risk! It may have publicly disclosed vulnerabilities.

Releases