2015-10-15 74 views
0

我已經按照以下步驟在Liferay 6.2 GA4中添加CKEditor YouTube插件,並且我可以在內容部分編輯器中添加插件。在Liferay中安裝CKEditor插件

CKEditor的YouTube的插件:http://ckeditor.com/addon/youtube

所有的插件都位於$ {LIFERAY_HOME} \ Tomcat的7.0.42 \的webapps \ ROOT \ HTML \ JS \編輯\ CKEditor的\ plugins文件夾。

1)將youtube插件文件夾放入插件文件夾中。

2)添加下面的位於$ {} LIFERAY_HOME config.js文件變化\ Tomcat的7.0.42 \的webapps \ ROOT \ HTML \ JS \編輯\ CKEditor的文件夾

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

3)添加繼位於$ {LIFERAY_HOME} \ Tomcat的7.0.42 \的webapps \ ROOT \ HTML \ JS \編輯\ CKEditor的文件夾

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的ckconfig.jsp文件'的YouTube'項。

我知道這可以通過使用Liferay Hook項目來實現。

但是,當我使用Liferay Structures and Templates時,這個插件沒有出現在CKEditor中。 Liferay服務器需要做哪些其他更改?

回答

0

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