shel / neos-previewselectbox
1.1.0
2023-10-04 19:45 UTC
Requires
- neos/neos: ^4.3 || ^5.0 || ^7.0 || ^8.0 || dev-master
README
此插件添加了 Neos selectbox 编辑器的新变体,支持选项上的 preview
属性,并在选择 selectbox 中的项目时显示这些属性。
在 Neos CMS 中,只有 AssetEditor
和 NodeEditor
具有此功能,并且目前尚无法将其用于其他数据类型。
⚠️ 此功能已集成到 Neos CMS(7.3+),此插件允许在 Neos 4.3+ 旧版本中使用。请参阅 pull request 和相关问题以获取详细信息。当 Neos 7.3 达到 EOL 时,此软件包将归档,且不再添加新功能!
安装
通过 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