Liferay 6.2添加一个新的ckeditor [英] Liferay 6.2 adding a new ckeditor
问题描述
我想为我的liferay添加一个新的ckeditor,因为我们需要限制一个可用的功能。但是,我不想改变原来的,因为我们后来需要它以不同的形式。
如何添加可用于为web内容文章创建结构的新ckeditor?我需要为liferay或类似的东西创建一个新的主题吗?
信息:我们的liferay运行在Jboss服务器上
EDIT:
我创建了一个钩子,覆盖 html \js\ \\ckeditor\ckconfig.jsp
文件并添加
config.toolbar_Mini = [
['Bold','Italic','Underline','Strike'],
['BulletedList']
];此外,我改变了关于 liferay-ui的行:
<文件中的 \html\portlet\journal\article\content.jsp
中的输入编辑器
< div class =journal-article-component-container>
< liferay-ui:input-editor contentsLanguageId =<%= Validator.isNotNull(toLanguageId)?toLanguageId:defaultLanguageId%> editorImpl =<%= EDITOR_WYSIWYG_IMPL_KEY%> name =articleContenttoolbarSet =Miniwidth =100%/>
< / div>
其他 toolbarSet
例如 phone
或 simple
)也没有效果。
我也重新启动我的jboss服务器几次 - 仍然没有效果。
也似乎,在 html \\ js \editor\ckeditor\config.js
文件对任何内容(例如 alert(foo)
绝对没有影响)。
您可以使用 toolbarSet
c> lifeary-ui:input-editor 标签。
您必须使用liferay-plugin钩子来覆盖ckconfig.jsp,配置,代表您的customr工具栏。
例如将以下代码添加到ckconfig.jsp。
config.toolbar_customToolbar = [
['FontSize','TextColor','BGColor',' - ','Bold','Italic' ','Strike']];
然后使用 lifeary-ui:input-editor
标签,提供toolbarSet属性值为 toolbarSet = custom-toolbar
。
FYI:文本格式化程序用于映射config.toolbar_XXXXX,因此toolbarSet的自定义工具栏值将映射到customToolbar(config.toolbar_customToolbar)。
希望这有助于。
I want to add a new ckeditor to my liferay because we need to limit the functionality of the one available. However, I do not want to change the original one because we migth later on need it in a different form.
How can I add a new ckeditor that can be used to create a structure for webcontent articles? Do I need to create a new Theme for liferay or something like this?
Info: Our liferay runs on a Jboss server
EDIT:
I have created a hook that overrides the html\js\editor\ckeditor\ckconfig.jsp
file and added
config.toolbar_Mini = [
['Bold', 'Italic', 'Underline', 'Strike'],
['BulletedList']
];
Additionally, I have changed the lines in the concerning the liferay-ui:input editor
in the \html\portlet\journal\article\content.jsp
file.
<div class="journal-article-component-container">
<liferay-ui:input-editor contentsLanguageId="<%= Validator.isNotNull(toLanguageId) ? toLanguageId : defaultLanguageId %>" editorImpl="<%= EDITOR_WYSIWYG_IMPL_KEY %>" name="articleContent" toolbarSet="Mini" width="100%" />
</div>
Other toolbarSet
options which are already available (e.g. phone
or simple
) also have no effect.
I also restarted my jboss-server several times - still no effect.
Also it seems, that changes made in the html\js\editor\ckeditor\config.js
file have absolutely no effect on anything (e.g alert("foo")
).
You can make use of toolbarSet
attribute of lifeary-ui:input-editor
tag.
You have to override ckconfig.jsp using liferay-plugin hook to add your custom ckeditor configuration which represent your customr toolbar.
e.g. Add below code to ckconfig.jsp.
config.toolbar_customToolbar=[
['FontSize', 'TextColor', 'BGColor', '-', 'Bold', 'Italic', 'Underline', 'Strike']];
And then while using lifeary-ui:input-editor
tag, provide toolbarSet attribute value as toolbarSet=custom-toolbar
.
FYI: text formatter is used to map config.toolbar_XXXXX so custom-toolbar value of toolbarSet will map to customToolbar (config.toolbar_customToolbar).
Hope this helps.
这篇关于Liferay 6.2添加一个新的ckeditor的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!