I wanted to extend the toolbar with one single additonal icon of a plugin. I do like the default icon set and the arrangements. Thus, I was looking for a config-approach to simply inherit that default toolbar and extend it by one line of configuration, which appends that new icon to the toolbar.
Is that a fair approach and feasible or am I supposed to copy the generated toolbargroup values from the site and add a javascript line for the new icon in there?
Any comments on best-practices appreciated.
Did you implement this plugin
Did you implement this plugin or you're just using it?
If you implemented it, then of course you have full control over where the button will be added. You control this by the toolbar property of the button definition. I cannot find it documented, but basic usage is show in the plugin tutorial, so you specify just the toolbar group name in which this plugin will be placed. You can read more about groups here: http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-toolbarGroups. However, as you can find e.g. in addButton documentation, you can also specify the order which will be taken into consideration when sorting buttons in a group. You can also create new groups.
If you're just using someone's plugin and you want to move one button, then you can of course reconfigure entire toolbar using either config.toolbar or config.toolbarGroups. These are the standard ways. However, you can also override button's toolbar property and if you do that in correct moment, the button will be assigned to different group:
Now, the bold button will assigned to "insert" group and will be placed at the end of it.
Piotrek (Reinmar) Koszuliński
CKEditor JavaScript Developer
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
Adding the PBCK Icon to the toolbar
Sorry, Piotrek. I could have said that I'm trying to install the PBCK Code Editor.
I customized the Full CKEditor 4.3.4. and customized it by adding the Code Editor (PBCK Editor). When I click into the inline editor area, the toolbar shows up. The issue is, that I would expect the pbck editor icon to appear. But, it does not. The issue was - again - I like the toolbar settings, I simply want to append the PBCK editor icon. What puzzles me is that the icons from the other plugins (LATEX, Math editor) are displayed. See uploaded screenshot. Why is that?
So, your example of adding the icon manually when plugins are loaded, is making sense. I just need to find the PBCK editor button's instance name and then invoke
I give that a shot. Thank you. Hope this helps others, too.
http://ckeditor.com/addon/pbckcode
Attachments:
Thanks a lot Reinmar, you
Thanks a lot Reinmar, you solved my issue.
I have developed a set of plugins, for which I have defined a toolbar group. But I was disturbed by the fact that buttons were ordered randomly within the group. I didn't notice the possiblity to indicate the order when assiging a plugin to a toolbar group.
It would be nice to have it mentionned in the plugin tutorial, as well as in the addButton documentation, which doesn't provide any explanation (only the code example includes the order.)
Anyway, thanks again.
I have developed a set of
I reported a ticket for this: https://github.com/ckeditor/ckeditor-docs/issues/22. Thanks.
Piotrek (Reinmar) Koszuliński
CKEditor JavaScript Developer
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+