0

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. phoneor 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")).

Massimo Rosin
  • 163
  • 1
  • 13

1 Answers1

0

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.

Pankaj Kathiriya
  • 4,210
  • 2
  • 19
  • 26
  • If I change the `toolbarSet` in my `content.jsp` file of the ckeditor, where the `liferay-ui:input-editor` tag is, to he name of my toolbar, nothing happens. I've created a toolbar `config.toolbar_Mini` and added it with `toolbarSet="Mini"`. – Massimo Rosin May 11 '16 at 07:20
  • Please let me know complete detail what you have tried? – Pankaj Kathiriya May 11 '16 at 14:07
  • 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. I also restarted my jboss-server several times - still no effect. – Massimo Rosin May 11 '16 at 14:19
  • Thanks for details, would it be possible for you to update question with exact change details ? – Pankaj Kathiriya May 11 '16 at 14:23
  • Thanks, I did not get your last statement `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")).` – Pankaj Kathiriya May 11 '16 at 15:06
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/111697/discussion-between-massimo-rosin-and-pankajkumar-kathiriya). – Massimo Rosin May 12 '16 at 06:11