Custom ckEditor Toolbar in Liferay 6.2

笑着哭i 提交于 2020-01-07 04:34:48

问题


I want to add my own custom toolbar for my ckeditor and have therefore added this to my ckconfig.jsp via a hook.

config.toolbar_Mini = [
    ['Bold', 'Italic', 'Underline', 'Strike'],
    ['BulletedList']
];

Additionally I've found out that liferay uses the config.toolbar_liferaysettings. How (code) and where (file) can I change this default behaviour?

EDIT: This is how the html-editor for my journal-articles looks now:

and I want to limit the functionality of the toolbar to this:

I do not want to change the default config.toolbar_liferay toolbar because I might need a different toolbar later on. Is this the correct way to achieve this (via hook?) or can I just add a new completely new ckeditor that can be used in a structure?


回答1:


Below configuration settings represents configuration for journal article ck-editor screen. From ckconfig.jsp of source code. config.toolbar_liferayArticle = [ ['Styles', 'FontSize', '-', 'TextColor', 'BGColor'], ['Bold', 'Italic', 'Underline', 'Strike'], ['Subscript', 'Superscript'], '/', ['Undo', 'Redo', '-', 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'SelectAll', 'RemoveFormat'], ['Find', 'Replace', 'SpellChecker', 'Scayt'], ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'], ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], '/', ['Source'], ['Link', 'Unlink', 'Anchor'], ['Image', 'Flash', <c:if test="<%= XugglerUtil.isEnabled() %>">'Audio', 'Video',</c:if> 'Table', '-', 'Smiley', 'SpecialChar', 'LiferayPageBreak'] ];

So, if you want to have different configuration setting for CKEditor of journal-article then you have to modify config.toolbar_liferayArticle in ckconfig.jsp using liferay plugin hook.

e.g config.toolbar_liferayArticle=[ ['Bold', 'Italic', 'Underline', 'Strike'], ['BulletedList'] ];



来源:https://stackoverflow.com/questions/37141391/custom-ckeditor-toolbar-in-liferay-6-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!