【问题标题】:Liferay 6.2 adding a new ckeditorLiferay 6.2 添加了一个新的 ckeditor
【发布时间】:2016-05-09 11:12:30
【问题描述】:

我想在我的 liferay 中添加一个新的 ckeditor,因为我们需要限制可用的功能。但是,我不想更改原来的,因为我们以后可能需要它以不同的形式。

如何添加一个新的 ckeditor 来创建网络内容文章的结构?我是否需要为 liferay 或类似的东西创建一个新主题?

信息:我们的 liferay 运行在 Jboss 服务器上

编辑:

我创建了一个覆盖html\js\editor\ckeditor\ckconfig.jsp 文件的钩子并添加了

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

此外,我还更改了\html\portlet\journal\article\content.jsp 文件中有关liferay-ui:input editor 的行。

<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>

其他已经可用的toolbarSet 选项(例如phonesimple)也无效。 我还重新启动了我的 jboss-server 几次 - 仍然没有效果。

另外,html\js\editor\ckeditor\config.js 文件中所做的更改似乎对任何东西都没有影响(例如 alert("foo"))。

【问题讨论】:

    标签: ckeditor liferay liferay-6 liferay-6.2


    【解决方案1】:

    你可以利用lifeary-ui:input-editor标签的toolbarSet属性。

    您必须使用 liferay-plugin 挂钩覆盖 ckconfig.jsp 以添加代表您的自定义工具栏的自定义 ckeditor 配置。

    例如将以下代码添加到 ckconfig.jsp。 config.toolbar_customToolbar=[ ['FontSize', 'TextColor', 'BGColor', '-', 'Bold', 'Italic', 'Underline', 'Strike']];

    然后在使用lifeary-ui:input-editor标签时,提供toolbarSet属性值为toolbarSet=custom-toolbar

    仅供参考:文本格式化程序用于映射 config.toolbar_XXXXX,因此工具栏集的 custom-toolbar 值将映射到 customToolbar (config.toolbar_customToolbar)。

    希望这会有所帮助。

    【讨论】:

    • 如果我更改 ckeditor 的 content.jsp 文件中的 toolbarSetliferay-ui:input-editor 标记所在的位置,对于我的工具栏的名称,没有任何反应。我创建了一个工具栏config.toolbar_Mini 并添加了toolbarSet="Mini"
    • 请告诉我您尝试过的完整细节?
    • 我创建了一个覆盖html\js\editor\ckeditor\ckconfig.jsp 文件的钩子并添加了config.toolbar_Mini = [ ['Bold', 'Italic', 'Underline', 'Strike'], ['BulletedList'] ];。此外,我更改了\html\portlet\journal\article\content.jsp 文件中有关liferay-ui:input editor 的行。我还重新启动了我的 jboss-server 几次 - 仍然没有效果。
    • 感谢您提供详细信息,您是否可以使用确切的更改详细信息更新问题?
    • 谢谢,我没有收到你最后的声明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")).
    猜你喜欢
    • 1970-01-01
    • 2014-10-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-01
    • 1970-01-01
    相关资源
    最近更新 更多