Open armellarcier opened 3 years ago
Could be done with a data-attribute on the textarea
tag, so with attr
config but it will not allow for formatting functions.
Better register javascript Pell configuration object and use those.
I'd need a few directions before creating a PR.
The actions are defined here: https://github.com/monsieurbiz/SyliusRichEditorPlugin/blob/26a41cb575b773864103d87a8c654b9e858f3f6c/src/Resources/views/Admin/app.html.twig#L86-L103
But it is for all wysiwyg fields. It could be possible to pass the actions directly to an attribute of the field, using data-actions
as example, and a json encoded value.
Then add a condition here to initialize Pell with those actions if they exist:
https://github.com/monsieurbiz/SyliusRichEditorPlugin/blob/26a41cb575b773864103d87a8c654b9e858f3f6c/assets/js/app.js#L32
Another way could be to register somewhere more Pell configurations identified by a specific name, and use that name in the attribute to setup pell for each wysiwyg field. This is much better actually but it'll require a bit more code.
I'm wondering whether this plugin should be so opinionated on the js text editor to use altogether.
We need at least a way to configure Pell's toolbar globally and for individual UiElements but why not allow replacing the editor library?
If you want to replace the library you are free to do so ;). But we won't change the library here because the goal is to have something really simple.
Sure, I just meant supporting / documenting text editing lib switch
Yes but why documenting a feature which doesn't exist yet? :p
I'm actually making the scope of this issue wider than just "toolbar customization"
I need a field with only the
h3
and paragraph levelsI'd like to add a configuration in my form builder to customize the Wysiwyg toolbar.