Problem

When I enable the "htmlbuttons"-Plugin for CKEditor 4, its default (test) icons are not displayed for selection in the "all buttons" set of the profiles configuration view.

That is, CKEditor module does recognize the plugin's presence (hence the checkbox with description being shown),
but something goes wrong with implementing the plugin's functionality (which seems to be fine in other setups like standalone or in wordpress).

Setup

  • Drupal 7.19
  • CKEditor Module
    installed to sites/all/modules
  • CKEditor Library
    • Versions:
      I have tried both CKEditor 4.0.1 and CKEditor 4.0.1.1 FULL versions
      as well as trying to use v4.0 (alas only STANDARD available), to which the plugin was built.
    • Paths:
      I have tried different variants:
      sites/all/libraries/ckeditor, sites/all/modules/ckeditor/ckeditor, and an instance in both locations (suggested solution that worked for some in a similar issue).
  • htmlbuttons plugin location: sites/all/modules/ckeditor/plugins, then also added it to sites/all/modules/ckeditor/ckeditor/plugins and sites/all/libraries/ckeditor/plugins.

Having read a few related issues (especially 1899652 - can't add new icons..., 1908736 - some widgets missing...), I

  • have given special attention to clearing caches,
  • have installed a double instance of CKEditor in the sites/all/libraries as well as doing the same for the plugin itself.
  • have added the (probably redundant, seeing the module has already understood that the plugin is there!) config.extraPlugins='htmlbuttons'; to CKEditor module's ckeditor.config.js, as well as - in an act of desperation - to the CKEditor's config.js.

Also, the site log shows no errors, and there are no javascript errors being detected by firefox (v.19.0).

Unfortunately, always with the same results: I can enable the plugin but its buttons never show up.
It's not that they are just not visible, there is no list-item being created for them in the output for the "all buttons" display.

What can be going wrong here?
Thank you very much in advance.

CommentFileSizeAuthor
#9 button-subheading.tar_.gz1.46 KBstevecty
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

stevecty’s picture

Im having the same issue. do u find the solution yet?

calliandra’s picture

Hi Steve,

no unfortunately I haven't found a solution, though I have also brought this up in CKE forums.
Instead, further instances of this problem with another plugin (languages, which however was written to a v3.x of CKE, socommon sense tells me the cause may be different in this case) has cropped up.

My main issue is that I cannot even discern whether it is a module issue or something CKE internal causing this.

Any help would be greatly appreciated!

raulnavas’s picture

For now the only option is to use the version 3.6.6 (http://ckeditor.com/)

wwalc’s picture

In Advanced options (at the bottom) you may set the toolbar to whatever you want.

Cons: the GUI to modify the toolbar will be useless.
Pros: the buttons that were added through the config option of a custom plugin can be easily added manually.

config.toolbar_Basic = [["Bold","Italic","-","NumberedList","BulletedList","-","Link","Unlink","-","Maximize", "About", '-', 'button1', 'button2', 'button3']];

The reason why the toolbar should be set this way is that this particular plugin has a very unique way of adding a button to the toolbar, which is too hard to be discovered by parsing the JS file with PHP.
-----------

Ideally, someone that loves that plugin should write a dedicated module that:
- enables this plugin through hook_ckeditor_plugin()
- adds an administration interface to define new buttons, which passess later all buttons to CKEditor through hook_ckeditor_plugin().

I guess it will be not that easy to create an administration interface for it because one should be able to specify an icon for each button... so I guess the simpler option would be to create a "dumb" module with hardcoded buttons / icons, which each admin could adopt to his needs.

calliandra’s picture

Category: support » bug

As Raul suggested, I tried installing CK 3.6.6.1 but was confronted with the same problem.

Finally, I disabled the Drag&Drop feature of the config interface in global profile settings, and was thus able to add the button manually.
The plugin works perfectly now.

The same is true of other additional plugins that can be enabled but whose buttons do not get displayed in the Drag&Drop interface.

For this reason, I am changing the category to bug report.

Workaround until this is fixed:

  1. disable the Drag&Drop feature in the CK Editor Global profile
  2. on the individual profile config page, enable the desired extra plugins in the Plugins list
  3. and add the desired button(s) manually to the Toolbar configuration field
calliandra’s picture

Hello Wiktor,
Thank you for the explanation!

I still think there is justification for my just having changed the category to bug report, since, when I re-enable Drag&Drop and go to the profile config, the toolbar preview still doesn't display the buttons (already manually declared, so I'd think the UI-code shouldn't have any more problems finding & displaying them??).

Another plugin I was experiencing problems with is the languages plugin.
(to make this one work in CKE v4.x, one needs to remove the dependencies

requires : [ 'styles', 'button' ],

declared in its plugin.js, as those relate to the CKE 3.6.2 version it was written to. However, they are unnecessary for the plugin's functionality in CKE v4.x)

This plugin, (kind of similarly to HTMLButtons?), assembles its dropdown button from configurations that can be set in the plugin.js
The same problems with Drag&Drop as with HTMLbuttons also arise in this case, and the same solution (disable Drag&drop and add manually) also applies.

Could you have a quick look at the languages plugin too to check whether it would need the same kind of revision you suggested for HTMLbuttons?
While HTMLbuttons offers an optional feature, this one should actually be in CKE core, since being able to mark up the language of parts of a text is of great importance to web content accessibility. Thus I have also begun pushing for a plugin update at CK-dev, but may be oversimplifying steps needed to resolve the issue.
So your take on this is probably also valuable to advancing the default integration of CKE into D8.

Thanks!

wwalc’s picture

Thanks calliandra for your suggestion, it looks like a reasonable suggestion to port it to V4 and add to the addons page. It even don't have to land in core, having it available on the addons page will let anyone interested in adding it to the custom build.

I still think there is justification for my just having changed the category to bug report, since, when I re-enable Drag&Drop and go to the profile config, the toolbar preview still doesn't display the buttons (already manually declared, so I'd think the UI-code shouldn't have any more problems finding & displaying them??).

Well it does not work this way. CKEditor module scans plugin definitions to get the list of buttons and their icons. Your manual addition of buttons in toolbar definition (when D&D is off) does not help here in any way to gather paths to icons to display them in the administration toolbar.

Well... as a fallback, we could simply display just "text icons" for these custom buttons. Any patches are welcome :-)

calliandra’s picture

Well it does not work this way. CKEditor module scans plugin definitions to get the list of buttons and their icons.

So do I understand rightly that the Languages plugin (amongst others) needs to define its buttons in some more "standard" way for them to be recognized by the CKmodule UI (or is it, as I was assuming when changing this into a bug, the Module code that needs revision as to be able to make extra plugins available via the D&D UI)?

What irritates me here is that the Editor itself has no problems at all with these differently set up extra plugins, while the Module UI does!

stevecty’s picture

FileSize
1.46 KB

Hi calliandra,

I managed to solve my problem by creating my own plugin.

As my purpose of use is to create a button to apply styles on the highlighted text which is a bit different than what htmlbuttons 1.0 provides.

I've uploaded the plugin i created, what it does is apply h4 & center styles to the highlighted text. Just drop it into sites/all/modules/contrib/ckeditor/plugins/ and it will show up in the editor appearance settings of ckeditor.

Have a look at the code, hopefully can help with what u need.