Please consider using other solutions for adding classes to CKEditor Elements in Neos, eg. https://github.com/visol/Visol.Neos.LinkClass
This package extends the CKEditor 5 link editor with the functionality to add preconfigured CSS classes to selected links.
composer require netlogix/ckeditor-linkclass
- Define within the
Settings.yaml
which CSS classes for links are available for the concrete Neos CMS installation:
Netlogix:
CkEditor:
LinkClass:
options:
'primaryButton':
label: 'Primary Button'
class: 'btn btn-primary'
position: '10'
'secondaryButton':
label: 'Secondary Button'
class: 'btn btn-secondary'
position: '20'
- Define which previously defined CSS classes can be applied to links in the individual NodeTypes properties of the concrete Neos CMS installation:
'Neos.Demo:Text':
properties:
text:
ui:
inline:
editorOptions:
linking:
netlogixLinkClass:
primaryButton: true
secondaryButton: true
You are welcome to contribute by making pull requests, adding issues, etc.
After modifying the JavaScript source code of the package, the JavaScript files can be rebuilt using the following steps:
cd Resources/Private/CKEditor/LinkClass
nvm use
yarn
yarn build
Then commit the modified files including Plugin.js
and Plugin.js.map
.