Needs review
Project:
CKEditor Widgets
Version:
7.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
3 Mar 2015 at 09:17 UTC
Updated:
20 Jun 2016 at 16:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jlyon commentedThat has been outside of my original scope for a couple reasons:
1) The templates require CKEditor's widgets api, so it won't work with any of the other editors that WYSIWYG supports
2) CKEditor support is in D8 core.
That said, I don't think support would be too difficult, and you could probably hack it together with a simple JS file if you're dying for support and need to stick with WYSIWYG (to support multiple editors, for example). I'll try to play around with it a little this afternoon, and post an example support module if I can make it work. I'll also accept patches if you can get it working properly with the WYSIWYG hooks.
Comment #2
jlyon commentedHere's a patch that adds WYSIWYG module support. Just patch the latest -dev version of the module, and check these boxes on your WYSIWYG profile page:
Let me know if you have any issues.
Comment #3
jlyon commented@phildu: have you had a chance to test this?
Comment #4
phildu commentedno not yet
Comment #5
rv0 commentedI've tried it (in a custom module though) and it seems to work.
I'm just wondering how I can control the buttons. I just want to use the quote widget for now actually
Comment #6
skar commentedI tried to apply this patch today for WYSIWYG module version "7.x-2.2+70-dev" and CKEditor version "4.5.5.b34ea4d".
The patch failed because CKEditor $version is now a string which isn't > (int)3.
As a quick fix, i just removed "if ($version > 3) {" and it's matching "}" in your patch and i can now display & enable the 3 options in WYSIWYG profile edit page.
Back on my node edit, CKEditor was not loading because the CKEditor plugins "widget" & "lineutils" were missing. I added them in "site/all/libraries/ckeditor/plugins/" folder.
And it's now working smoothly.
Thanks
Comment #7
rv0 commented@skar indeed, you need to add those plugins. You can also do that in a custom module using hook_wysiwyg_plugin in similar way as this patch does.
To answer my own question in #5, you can control the buttons with widgettemplatemenuButtons option.
E.g. i only needed 2 col and 3 col templates, so in hook_wysiwyg_editor_settings_alter I added:
$settings['widgettemplatemenuButtons'] = 'widgetbootstrapTwoCol,widgetbootstrapThreeCol';