sitegeist/silhouettes

预配置可以应用于多个NodeTypes各种属性的属性轮廓。

v2.0.2 2022-04-12 15:05 UTC

This package is auto-updated.

Last update: 2024-09-12 20:12:03 UTC


README

Neos 7.0 包含了 Sitegeist.Silhouettes 的功能作为 NodeType 预设。这个包最终将废弃,以支持那个!

Neos.ContentRepository 的集中属性配置

在多个 NodeTypes 中,属性通常期望具有相同的操作行为。这通常通过混入实现,但那些绑定到固定属性名的混入不能覆盖具有不同名称的属性具有相似性的情况。

Sitegeist.Silhouettes 包使用来自多个 NodeTypes 设置中的预配置属性配置。这为混入不足以使用,并且需要在具有不同名称的属性之间同步设置的情况提供了集中属性配置的方法。

还可以为子节点约束配置创建轮廓,例如,根据dry原则将相同的集中约束应用于不同的子节点。当使用单个 NodeType 包在不同 neos 实例中时,这也可能很有用,其中约束可能不同。

配置的轮廓中的设置与在具有本地配置的节点类型中找到的配置合并,本地配置优先于轮廓。

作者 & 赞助商

这个包的开发和公共发布得到了我们雇主http://www.sitegeist.de的慷慨赞助。

使用方法

Settings.yaml

Sitegeist:
  Silhouettes:
    properties:
      vendor:
        text:
          block:
            type: string
            defaultValue: ''
            ui:
              inlineEditable: true
              inline:
                editorOptions:
                  placeholder: '(( text block ))'
                  autoparagraph: true
                  linking:
                    anchor: true
                    title: true
                    relNofollow: false
                    targetBlank: false
                  formatting:
                    strong: true
                    em: true
                    u: false
                    underline: false
                    strikethrough: false
                    sub: false
                    sup: false
                    del: false
                    p: true
                    h1: false
                    h2: false
                    h3: false
                    h4: false
                    h5: false
                    h6: false
                    pre: false
                    removeFormat: true
                    left: false
                    right: false
                    center: false
                    justify: false
                    table: false
                    ol: false
                    ul: false
                    a: true
  
      childNodes:
        vendor:
          defaultConstraints:
            constraints:
              'Neos.Neos:Content': true
              'Neos.NodeTypes.BaseMixins:TitleMixin': true
              'Neos.Demo:Constraint.Content.Carousel': true
              'Neos.Demo:Constraint.Content.Column': false

NodeTypes.yaml

'Vendor.Package:NodeTypeName':
  childNodes:
    column1:
      options:
        silhouette: 'vendor.defaultConstraints'    
    column2:
      options:
        silhouette: 'vendor.defaultConstraints'    
  properties:
    description:
      ui:
        label: 'Description'
        inline:
          editorOptions:
            placeholder: 'please add description ... '
      options:
        silhouette: 'vendor.text.block'

预定义轮廓

  • text.plain: 不允许格式化的内联可编辑字符串。
  • text.block: 允许内联格式化的内联可编辑字符串。
  • text.free: 允许包括块在内的所有格式化的内联可编辑字符串。

安装

Sitegeist.Silhouettes 可通过 packagist 获取。将 "sitegeist/silhouettes" : "^1.0" 添加到 composer.json 的 require 部分,或者运行 composer require sitegeist/silhouettes

我们使用语义版本控制,每次重大更改都会增加主版本号。

贡献

我们非常乐意接受贡献。请发送给我们 pull request。