breadlesscode / neos-simple-editor-extend
扩展 Neos CMS 编辑器的简单方法
v3.2.0
2023-05-04 10:01 UTC
Requires
- neos/neos-ui-compiled: ^4.0 || ^5.0 || ^7.0 || ^8.0 || ^9.0
This package is auto-updated.
Last update: 2024-09-18 23:03:27 UTC
README
这是一个小型插件,可以简单地向 Neos CMS CKEditor 添加一些按钮,无需编写任何 JavaScript 代码。您只需要编写一个 YAML 文件。
安装
大多数时候,您需要调整一个包(例如,Settings.yaml 中的配置)。因此,将相应的包添加到您的主题 composer.json 中非常重要。通常,这个包位于 Packages/Sites/ 下的站点包。要正确安装,请转到您的主题包(例如,Packages/Sites/Foo.Bar)并运行以下命令:
composer require breadlesscode/neos-simple-editor-extend --no-update
使用 --no-update 命令可以防止依赖项自动更新。将包添加到您的主题 composer.json 后,返回 Neos 安装根目录并运行 composer update。您的包现在已正确安装。
演示
示例配置
Neos: Neos: Ui: frontendConfiguration: 'Breadlesscode.SimpleEditorExtend:Buttons': 'Test.Test:MyCustomSpan': extensionName: 'exampleExtension' icon: 'plus-square' tooltip: 'Mark the text in color green' position: 'before strong' formatting: tag: 'span' classes: 'test-class' styles: background-color: 'green' 'Test.Test:MyCustomSpan2': extensionName: 'exampleExtension2' icon: 'rocket' tooltip: 'Mark the text in color red' position: 'before exampleExtension' formatting: tag: 'span' classes: 'test-class-2' styles: background-color: 'red'
现在您可以使用以下方式使用您的新格式化选项
'Neos.NodeTypes.BaseMixins:TextMixin': properties: text: ui: inline: editorOptions: formatting: 'Test.Test:MyCustomSpan': true 'Test.Test:MyCustomSpan2': true
许可证
GNU 通用公共许可证第 3 版。请参阅许可证文件以获取更多信息。