Hi, I'm trying to install the tabletoolstoolbar plugin to a standard location but a lot of ckeditor plugin modules use either "/libraries/{plugin-name}" or "/libraries/ckeditor/plugins/{plugin-name}".

From @rooby via this issue https://www.drupal.org/project/fakeobjects/issues/3046776:

"Looking at other CKEditor plugin modules and some of the documentation on drupal.org, it seems to be a defacto standard to have ckeditor plugins in libraries/ckeditor/plugins/pluginname.

This makes sense since it removes the risk of confusion and conflicts with non-ckeditor libraries that might have the same name and CKEditor's default instructions are to put plugins in a plugins sub-directory, which is what Drupal core does with its default CKEditor plugins.

If we can get consistency with where CKEditor plugin modules store their libraries it also makes it easier to manage all CKEditor plugins in a uniform manner."

CommentFileSizeAuthor
support_alt_library_location.patch6.67 KBrromore

Comments

rromore created an issue. See original summary.

a.milkovsky’s picture

Status: Active » Needs work

Hello,

Looking at other CKEditor plugin modules and some of the documentation on drupal.org, it seems to be a defacto standard to have ckeditor plugins in libraries/ckeditor/plugins/pluginname.

Could yu please provide links to the documentan?

  1. +++ b/src/Plugin/CKEditorPlugin/CkeditorTableToolsToolbar.php
    @@ -5,6 +5,9 @@ namespace Drupal\ckeditor_tabletoolstoolbar\Plugin\CKEditorPlugin;
    +define('TABLETOOLSTOOLBAR_LIBRARY_PATH', 'libraries/tabletoolstoolbar/plugin.js');
    

    these 2 constants should be class constants.

  2. +++ b/src/Plugin/CKEditorPlugin/CkeditorTableToolsToolbar.php
    @@ -122,8 +126,30 @@ class CkeditorTableToolsToolbar extends CKEditorPluginBase {
    +    // Support for "Libraries API" module.
    

    we can cache the result here in a protected class property $this->profilePath. In this case we can keep calling $this->getPluginPath() above as before.

  3. +++ b/src/Plugin/CKEditorPlugin/CkeditorTableToolsToolbar.php
    @@ -122,8 +126,30 @@ class CkeditorTableToolsToolbar extends CKEditorPluginBase {
    +    foreach ([TABLETOOLSTOOLBAR_LIBRARY_PATH, TABLETOOLSTOOLBAR_CKEDITOR_PATH] as $derivative) {
    

    we should inclde the default Drupal "libraries" folder here as well because some projects already use this modle in producion.