I was reading the blog post from Marky Roden about ‘How to easily hide an XPages CKEditor toolbar‘. I was thinking back at e-office I wrote also a blog about customising the Toolbar of the CKEditor. I found it in the way back machine, because the took the domino-weblog down after I left. Here is a link to the way back machine entries of that blog.
Below is a copy of the original blog
How it started
I have build a Social Intranet Framework powered by XPages, included integration with IBM Connection.
When I was at a customer to implement the framework on their Domino server, the content manager was wondering if it was possible to paste HTML code inside the richtext fields. Which is based on CKEditor.
So after some research I found the toolbar was build up by several plugins.
So a quick fix was made to the code to load the Source button and the content was able to add some weather information HTML in the widget.
My solution
I was thinking about a more solid solution. Why not give the intranet admin the opportunity to decide which plugin should be available for the content managers.
At the website of the CKEditor I found a list of possible toolbar options.
In the faces-config.xml I defined the toolbar managed bean
I created a XPages with the most common options for the toolbar, with the possibility to check an item if the option should be loaded.
On the save of the XPage, the managed bean will be updated with the latest choices.
On a content page where a Richtext field is used I added a ‘toolbar’ Dojo attribute to the field. The toolbar attribute will get the options from the Managed Bean which should be loaded.
The toolbarBean.composeToolbar calls the method in the bean to get all the needed options and produce the output in the correct syntax
I also made a small video to see the the toolbar configuration in action by checking and unchecking options and see the result in a richtextitem after a save.