问题
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_liferay
settings. 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