Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: TinyMCE cannot be configured as documented because some plugins are missing #17058

Open
LosHawlos opened this issue May 16, 2024 · 4 comments
Assignees
Labels

Comments

@LosHawlos
Copy link
Contributor

Pimcore version

11.2.3

Steps to reproduce

The Pimcore documentation for the TinyMCE Bundle links to the toolbar documentation page on the TinyMCE website.
Follow the instructions to include some configuration, in my case I want to use the anchor plugin, but many other plugins seem to be affected too.
Our configuration:
{ "toolbar1": "undo redo | removeformat code | link unlink | anchor", "toolbar2": "bold subscript superscript | bullist numlist", "paste_as_text": true, "plugins": [ "paste", "link", "anchor" ] }

Actual Behavior

Many plugins don't work, there will be JavaScript errors like for example:

Failed to load plugin: paste from url plugins/paste/plugin.min.js hS @ admin/misc/script-pr…ea4fe3eb8f505:12333 Failed to load plugin: anchor from url plugins/anchor/plugin.min.js hS @ admin/misc/script-pr…ea4fe3eb8f505:12333

Expected Behavior

The toolbar configuration options as described in the documentation can be used.

It seems that the TinyMCE Bundle in Pimcore does not provide all of the plugins available for TinyMCE. If that is the case there should be documentation that clearly lists all useable plugins.
Ideally there should be a description on how to add missing plugins in case the desired plugin is not part of the Pimcore Bundle.

@LosHawlos LosHawlos added the Bug label May 16, 2024
@olivermerz
Copy link

Same problem with the same Pimcore version as above, the plugin searchreplace is also not available or is not loaded.

@kingjia90
Copy link
Contributor

kingjia90 commented May 22, 2024

Thank you for reporting!
It seems that there are no plugins shipped with Pimcore by default, beside a help one
https://github.com/pimcore/pimcore/tree/11.x/bundles/TinymceBundle/public/build/tinymce/plugins

So to make it work, devs need to "copy" the official ones provided from TinyMCE that they specifically need for their projects and use this addonManager (and set a public path outside the pimcore repository folder)
https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.addonmanager/#examples-2

Can anybody please try it and provide a PR with examples and instructions for it? Thank you in advance

@olivermerz
Copy link

Thank you for reporting! It seems that there are no plugins shipped with Pimcore by default, beside a help one https://github.com/pimcore/pimcore/tree/11.x/bundles/TinymceBundle/public/build/tinymce/plugins

So to make it work, devs need to "copy" the official ones provided from TinyMCE that they specifically need for their projects and use this addonManager (and set a public path outside the pimcore repository folder) https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.addonmanager/#examples-2

Can anybody please try it and provide a PR with examples and instructions for it? Thank you in advance

@kingjia90 Your proposed solution worked for me.
In addition it's also possible using the external_plugins option instead after downloading the official plugins.

As an example (downloaded plugins placed in a bundle):

{
    ... ,
    plugins: '... searchreplace quickbars ...',
    external_plugins: {
        'searchreplace': '/bundles/BUNDLE_NAME/js/tinymce/v6.8.3/plugins/searchreplace/plugin.min.js',
        'quickbars': '/bundles/BUNDLE_NAME/js/tinymce/v6.8.3/plugins/quickbars/plugin.min.js'
    },
    ...
}

Tested on Pimcore 11.2.3 with TinyMCE 6.8.3.

@kingjia90
Copy link
Contributor

kingjia90 commented May 23, 2024

@olivermerz Thank you for letting me know, it's also nice to learn about external_plugins which makes it more easy to read/manage and looks less "global".

Switching this issue from Bug to Task, any volunteers for creating a nice documentation PR with examples? 😃 Thank you in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants