本文介绍了Liferay 6.2中的自定义ckEditor工具栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为我的ckeditor添加自己的自定义工具栏,因此已经通过钩子将其添加到我的ckconfig.jsp中.

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']
];

此外,我发现liferay使用config.toolbar_liferay设置.如何(代码)以及在何处(文件)更改此默认行为?

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

这就是我的期刊文章的html编辑器现在的外观:

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

,我想将工具栏的功能限制为:

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

我不想更改默认的config.toolbar_liferay工具栏,因为稍后可能需要其他工具栏.这是实现此目标的正确方法(通过钩子吗?)还是可以添加可以在结构中使用的全新的ckeditor?

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?

推荐答案

以下配置设置代表日记帐文章ck编辑器屏幕的配置.来自ckconfig.jsp的源代码.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'] ];

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'] ];

因此,如果要为journal-article的CKEditor具有不同的配置设置,则必须使用liferay插件钩子修改ckconfig.jsp中的config.toolbar_liferayArticle.

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.

例如config.toolbar_liferayArticle=[ ['Bold', 'Italic', 'Underline', 'Strike'], ['BulletedList']];

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

这篇关于Liferay 6.2中的自定义ckEditor工具栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 14:33