We just upgraded to XWiki 9.11.4 and are now using the CKEditor as the default WYSIWYG editor.
I would like to change the toolbar layout for TextArea objects depending on which page is loaded. If I make a change in the Global Adminstration:WYSIWYG Editor the changes propagate but I would like to set the toolbar to a very minimal set of buttons on certain pages, not every page.
From the CKEditor Class Config page something to the effect of
config.toolbar = [
[ ‘Source’, ‘-’, ‘Bold’, ‘Italic’ ]
];
I have followed http://extensions.xwiki.org/xwiki/bin/view/Extension/CKEditor%20Integration#HConfiguretheEditor Option 2 but that does not appear to change anything. I’m not exactly sure if I am implementing it correctly though. I was placing the code in a JSX on the Sheet page.
As usual, any help would be appreciated.
How do you load the JSX? On demand from the Shee page content or “Always on this wiki”?
I did have it on ‘On Demand’ but since you asked I figured I would try the other options. Setting it to ‘Always in this Wiki’ applies the changes.
Now, how do I change what toolbar buttons appear?
Thanks.
See https://github.com/xwiki-contrib/application-ckeditor/blob/master/webjar/src/main/resources/config.js#L93 (this is the default configuration). You either use the toolbarGroups configuration property or the removeButtons / removePlugins.
Thank you very much, that did. And for anyone else that is looking into this, beware of commas - too many or not enough will cause you head aches.
Everything is working well and I can make all the changes listed via the config with the exception of the font. I would like to change the size but can’t seem to set it correctly. Suggestions?
You want a different font size in edit mode than in view mode? You would loose the WYSIWYG aspect no?
No, I would like to set the font size programmatically.
Sure, but it would be different than in view mode no? So What You See Is not anymore What You Get.
I don’t think I am explaining it correctly. I guess what I want to do is change the editor’s default font size.
@stevem_jonesmetal I think you are explaining it well. @mflorea just refer to the fact that if the content in edit does not looks like the content in view (different font size here) as much as possible then it’s not exactly a WYIWYG anymore