在Liferay中安装CKEditor插件

在Liferay中安装CKEditor插件,liferay,Liferay,我已经按照这些步骤在Liferay 6.2 GA4中添加了CKEditor YouTube插件,并且可以在内容部分编辑器中添加插件 CKEditor YouTube插件: 所有插件都位于${LIFERAY\u HOME}\tomcat-7.0.42\webapps\ROOT\html\js\editor\ckeditor\plugins文件夹中 1将youtube插件文件夹放在插件文件夹中 2在${LIFERAY_HOME}\tomcat-7.0.42\webapps\ROOT\html\js\

我已经按照这些步骤在Liferay 6.2 GA4中添加了CKEditor YouTube插件,并且可以在内容部分编辑器中添加插件

CKEditor YouTube插件:

所有插件都位于${LIFERAY\u HOME}\tomcat-7.0.42\webapps\ROOT\html\js\editor\ckeditor\plugins文件夹中

1将youtube插件文件夹放在插件文件夹中

2在${LIFERAY_HOME}\tomcat-7.0.42\webapps\ROOT\html\js\editor\ckeditor文件夹中的config.js文件中添加以下更改

CKEDITOR.editorConfig = function( config ) {
            // Define changes to default configuration here. For example:
            // config.language = 'fr';
            // config.uiColor = '#AADC6E';
            config.extraPlugins = 'youtube';
};
config.extraPlugins = 'ajaxsave,media,restore,scayt,wsc,youtube';

config.toolbar_liferayArticle = [
['Styles', 'FontSize', '-', 'TextColor','BGColor'],
['Bold', 'Italic', 'Underline', 'Strike'],
['Subscript', 'Superscript'],['Youtube'],
'/',['Undo', 'Redo', '-', 'Cut', 'Copy', 'Paste',
'PasteText',  'PasteFromWord', '-', 'SelectAll','RemoveFormat'],
3在${LIFERAY_HOME}\tomcat-7.0.42\webapps\ROOT\html\js\editor\ckeditor文件夹中的ckconfig.jsp文件中添加以下“youtube”条目

CKEDITOR.editorConfig = function( config ) {
            // Define changes to default configuration here. For example:
            // config.language = 'fr';
            // config.uiColor = '#AADC6E';
            config.extraPlugins = 'youtube';
};
config.extraPlugins = 'ajaxsave,media,restore,scayt,wsc,youtube';

config.toolbar_liferayArticle = [
['Styles', 'FontSize', '-', 'TextColor','BGColor'],
['Bold', 'Italic', 'Underline', 'Strike'],
['Subscript', 'Superscript'],['Youtube'],
'/',['Undo', 'Redo', '-', 'Cut', 'Copy', 'Paste',
'PasteText',  'PasteFromWord', '-', 'SelectAll','RemoveFormat'],
4重新启动Liferay

我知道这可以通过使用Liferay钩子项目来实现


但是,当我使用Liferay结构和模板时,该插件不会出现在CKEditor中。Liferay server中还需要做哪些更改

在Liferay中使用结构和模板时,它由不同类型的CKEditor工具栏组成。这些不同的工具栏在ckconfig.jsp中定义,您需要更改所有工具栏部分

config.toolbar_email = [
    ['FontSize', 'TextColor', 'BGColor', '-', 'Bold', 'Italic', 'Underline', 'Strike'],
    ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
    ['SpellChecker', 'Scayt'],
    ['Youtube'],
    '/',
    ['Undo', 'Redo', '-', 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'SelectAll', 'RemoveFormat'],
    ['Source'],
    ['Link', 'Unlink'],
    ['Image']
];

config.toolbar_liferay = [
    ['Bold', 'Italic', 'Underline', 'Strike'],

    <c:if test="<%= inlineEdit %>">
        ['AjaxSave', '-', 'Restore'],
    </c:if>

    ['Undo', 'Redo', '-', 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', ],
    ['Styles', 'FontSize', '-', 'TextColor', 'BGColor'],
    ['Youtube'],
    '/',
    ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent'],
    ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
    ['Image', 'Link', 'Unlink', 'Anchor'],
    ['Flash', <c:if test="<%= XugglerUtil.isEnabled() %>"> 'Audio', 'Video',</c:if> 'Table', '-', 'Smiley', 'SpecialChar'],
    ['Find', 'Replace', 'SpellChecker', 'Scayt'],
    ['SelectAll', 'RemoveFormat'],
    ['Subscript', 'Superscript']

    <c:if test="<%= !inlineEdit %>">
        ,['Source']
    </c:if>
];

config.toolbar_liferayArticle = [
    ['Styles', 'FontSize', '-', 'TextColor', 'BGColor'],
    ['Bold', 'Italic', 'Underline', 'Strike'],
    ['Subscript', 'Superscript'],
    ['Youtube'],
    '/',
    ['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']
];