jvmtech/content-subgroups

通过创建子组和特定的迁移来减少内容类型(Neos CMS NodeTypes)的数量,以便于在它们之间轻松切换。

v0.0.2 2024-06-05 06:26 UTC

This package is auto-updated.

Last update: 2024-09-05 07:12:51 UTC


README

Latest Stable Version License

通过创建子组和特定的迁移来减少内容类型(Neos CMS NodeTypes)的数量,以便于在它们之间轻松切换。

  • 在内容创建对话框的第一步中减少杂乱
  • 每个融合原型一个内容类型(无布局混合属性)
  • 更改内容类型或现有节点时不会丢失数据

1. 创建仅在第1步内容创建对话框中可见的壳...

'Vendor:Subgroup.Image':
  superTypes:
    'Neos.Neos:Content': true
    'JvMTECH.ContentSubgroups:Enable': true
  ui:
    label: 'Image(s)'
    group: 'general'
  properties:
    targetNodeTypeName:
      ui:
        inspector:
          editorOptions:
            dataSourceAdditionalData:
              contentSubgroup: 'image'

'Vendor:Subgroup.Text':
  superTypes:
    'Neos.Neos:Content': true
    'JvMTECH.ContentSubgroups:Enable': true
  ui:
    label: 'Text'
    group: 'general'
  properties:
    targetNodeTypeName:
      ui:
        inspector:
          editorOptions:
            dataSourceAdditionalData:
              contentSubgroup: 'text'

2. 将实际内容类型映射到子组,可在第2步内容创建对话框中选择...

'Vendor:Content.Image':
  superTypes:
    'Neos.Neos:Content': true
    'JvMTECH.ContentSubgroups:Enable': true
  ui:
    label: 'Single Image'
    group: 'hidden'
  options:
    contentSubgroup:
      tags:
        - image

'Vendor:Content.ImageSwiper':
  superTypes:
    'Neos.Neos:Content': true
    'JvMTECH.ContentSubgroups:Enable': true
  ui:
    label: 'Image Swiper'
    group: 'hidden'
  options:
    contentSubgroup:
      tags:
        - image

'Vendor:Content.TextWithImage':
  superTypes:
    'Neos.Neos:Content': true
    'JvMTECH.ContentSubgroups:Enable': true
  ui:
    label: 'Text with image'
    group: 'hidden'
  options:
    contentSubgroup:
      tags:
        - text
        - image

'Vendor:Content.Bodytext':
  superTypes:
    'Neos.Neos:Content': true
    'JvMTECH.ContentSubgroups:Enable': true
  ui:
    label: 'Bodytext'
    group: 'hidden'
  options:
    contentSubgroup:
      tags:
        - text

'Vendor:Content.Quote':
  superTypes:
    'Neos.Neos:Content': true
    'JvMTECH.ContentSubgroups:Enable': true
  ui:
    label: 'Quote'
    group: 'hidden'
  options:
    contentSubgroup:
      tags:
        - text

3. 如有需要,可选地添加属性迁移...

'Vendor:Content.TextWithImage':
  options:
    contentSubgroup:
      propertyMigrationFrom:
        'Vendor:Content.Bodytext':
          'text':
            'MoveTo': 'imageText'
        'Vendor:Content.Quote':
          'quote':
            'MoveTo': 'imageText'
          'author':
            '/Vendor/Custom/AuthorNodeReferenceToAuthorAssetMigration': 'imageAsset'

'Vendor:Content.Bodytext':
  options:
    contentSubgroup:
      propertyMigrationFrom:
        'Vendor:Content.TextWithImage':
          'imageText':
            'MoveTo': 'quote'
        'Vendor:Content.Quote':
          'quote':
            'MoveTo': 'text'

'Vendor:Content.Quote':
  options:
    contentSubgroup:
      propertyMigrationFrom:
        'Vendor:Content.TextWithImage':
          'imageText':
            'moveTo': 'quote'
        'Vendor:Content.Bodytext':
          'text':
            'MoveTo': 'quote'
          'imageAsset':
            '/Vendor/Custom/ImageAssetToAuthorNodeReference': 'author'

安装

composer require jvmtech/content-subgroups

jvmtech.ch 提供