shel/neos-previewselectbox

该软件包已被弃用且不再维护。作者建议使用 neos/neos-ui 软件包。

添加了一个新的支持预览的 selectbox 编辑器

安装数: 8,189

依赖者: 0

建议者: 0

安全性: 0

星标: 4

关注者: 3

分支: 2

开放性问题: 0

语言:JavaScript

类型:neos-plugin

1.1.0 2023-10-04 19:45 UTC

This package is auto-updated.

Last update: 2024-04-23 06:41:12 UTC


README

此插件添加了 Neos selectbox 编辑器的新变体,支持选项上的 preview 属性,并在选择 selectbox 中的项目时显示这些属性。

在 Neos CMS 中,只有 AssetEditorNodeEditor 具有此功能,并且目前尚无法将其用于其他数据类型。

⚠️ 此功能已集成到 Neos CMS(7.3+),此插件允许在 Neos 4.3+ 旧版本中使用。请参阅 pull request 和相关问题以获取详细信息。当 Neos 7.3 达到 EOL 时,此软件包将归档,且不再添加新功能!

Example

安装

通过 composer 将 shel/neos-previewselectbox 软件包作为您的站点包的依赖项进行安装。

如何使用

而不是为每个值设置 icon 属性,您将 preview 设置为一个绝对 URI。

⚠️ 相对 URI 可能会工作,但官方不支持,因为它们可能无法在托管环境中可靠地解析。

使用数据源

确保数据源为每个返回的项目返回一个包含绝对 URL 的 preview 属性。

'My.Vendor:Content.Something':
  superTypes:
    Neos.Neos:Content: true
  ui:
    label: i18n
  properties:
    icon:
      type: string
      ui:
        label: 'Icon'
        reloadIfChanged: true
        inspector:
          group: icon
          editor: Shel.Neos/PreviewSelectBoxEditor
          editorOptions:
            placeholder: Select an icon
            allowEmpty: true
            dataSourceIdentifier: my-icon-datasource

不使用数据源

'My.Vendor:Content.Something':
  superTypes:
    Neos.Neos:Content: true
  ui:
    label: i18n
  properties:
    icon:
      type: string
      ui:
        label: 'Icon'
        reloadIfChanged: true
        inspector:
          group: icon
          editor: Shel.Neos/PreviewSelectBoxEditor
          editorOptions:
            placeholder: Select an icon
            allowEmpty: true
            values:
              'foo':
                label: Foo
                preview: https://some.url/my-foo-icon.svg
              'bar':
                label: Bar
                preview: https://some.url/my-bar-icon.svg