Fórum

Customizing FCK Editor in Liferay 6.0.4 - Development Strategy

thumbnail
Ashok Kumar, modificado 13 Anos atrás.

Customizing FCK Editor in Liferay 6.0.4 - Development Strategy

New Member Postagens: 6 Data de Entrada: 27/09/10 Postagens Recentes
Hi all,

I am using Liferay 6.0.4 bundled with Tomcat 6.0.26 and am trying to insert a few custom styles in the style drop down of the FCK Editor. Could someone suggest me a development strategy please as I am confused with the options available.

Here is what I have tried so far:

1. Downloaded the source from svn but could not run ant build-ext as the target does not exist in build.xml. I am relatively new to Liferay development and could not find any steps for setting up the Liferay ext environment except for some contradicting pointers that it is not available in Liferay 6.x.

2. Thinking of creating a Hook through the plugin SDK but not sure if this is the right strategy for the task. Will the hook also deploy the modified fckstyles.xml or is it only for overriding a JSP or action class?

Please could someone provide a brief 'Steps to do' for the task.

Using liferay-plugins-sdk-6.0.5. Should that be SDK 6.0.4 for a Liferay 6.0.4 ?
thumbnail
Hitoshi Ozawa, modificado 13 Anos atrás.

RE: Customizing FCK Editor in Liferay 6.0.4 - Development Strategy

Liferay Legend Postagens: 7942 Data de Entrada: 24/03/10 Postagens Recentes
I'm not sure what you're trying to do with the plugin. Couldn't you just edit the FCK script files in the tomcat-6.0.26\webapps\ROOT\html\js\editor\fckeditor?

BTW, FCK is being replaced with CK.
thumbnail
Ashok Kumar, modificado 13 Anos atrás.

RE: Customizing FCK Editor in Liferay 6.0.4 - Development Strategy

New Member Postagens: 6 Data de Entrada: 27/09/10 Postagens Recentes
Hi,

Many thanks for your pointer on the CKEditor. I am not sure whether Liferay6.0.4 starts with FCK or CK editor by default but the HTML source of the page contained references only to CKEditor. So I guess it is the CK Editor (screenshot attached) and assume that is why changes to the tomcat-6.0.26\webapps\ROOT\html\js\editor\fckeditor\fckstyles.xml did not reflect on the frontend.

However I tried figuring out where to insert the custom styles for CK editor but could not find a 'ckstyles.xml' or something similar inside tomcat-6.0.26\webapps\ROOT\html\js\editor\ckeditor.

So the questions would be:
1. How can we find out which editor is being displayed ? Where is this configured ?
2. In case it is a CK Editor, where would our custom styles and templates go ?
3. If any change to the editor is being done directly in the ROOT on our development workstation, will that suffice if we copy only the changed files to our test and production environments ?

Thanks a ton in advance for any help.

Regards,
Ashok
thumbnail
Ashok Kumar, modificado 13 Anos atrás.

RE: Customizing FCK Editor in Liferay 6.0.4 - Development Strategy

New Member Postagens: 6 Data de Entrada: 27/09/10 Postagens Recentes
Hi All,

Any pointers on this please ?
Oliver Bayer, modificado 13 Anos atrás.

RE: Customizing FCK Editor in Liferay 6.0.4 - Development Strategy (Resposta)

Liferay Master Postagens: 894 Data de Entrada: 18/02/09 Postagens Recentes
Hi Ashok,

I'll try to answer at least some of your questions.

1. As you can see in the following snippet each portlet which uses a wysiwyg editor is defined in portal.properties and thus can be overriden in the portal-ext.properties.
##
## Editors
##
#
# You can configure individual JSP pages to use a specific implementation of
# the available WYSIWYG editors: ckeditor, fckeditor, liferay, simple,
# tinymce, or tinymcesimple.
#
editor.wysiwyg.default=ckeditor
editor.wysiwyg.portal-web.docroot.html.portlet.blogs.edit_entry.jsp=ckeditor
editor.wysiwyg.portal-web.docroot.html.portlet.calendar.edit_configuration.jsp=ckeditor
editor.wysiwyg.portal-web.docroot.html.portlet.calendar.edit_event.jsp=ckeditor
editor.wysiwyg.portal-web.docroot.html.portlet.enterprise_admin.view.jsp=ckeditor
...


2. If you mean css changes with "styles" you can add them into your theme. Not sure what you meant with "templates"; if you want e.g. to modify the toolbar of the editor you can edit the ckconfig.jsp, create a new toolbar and change the toolbar name inside each portlet.

3. Look at my example in 2 to see what files you have to change too.

HTH Oli
thumbnail
Ashok Kumar, modificado 13 Anos atrás.

RE: Customizing FCK Editor in Liferay 6.0.4 - Development Strategy

New Member Postagens: 6 Data de Entrada: 27/09/10 Postagens Recentes
Hi Oliver,

Many thanks for the help. I would have to try this in the morning and shall let you know how it goes.

By the way, by template I meant the custom html templates available as a dropdown for placement of images and text inside the wysiwyg editor.

Regards,
Ashok
thumbnail
Ashok Kumar, modificado 13 Anos atrás.

RE: Customizing FCK Editor in Liferay 6.0.4 - Development Strategy

New Member Postagens: 6 Data de Entrada: 27/09/10 Postagens Recentes
Hi Oliver,

Thanks a lot. This worked like a breeze.

For the benefit of other readers, I had to simply add the custom styles to the theme's custom.css and use those classes in the \liferay-portal-6.0.5\tomcat-6.0.26\webapps\ROOT\html\js\editor\ckeditor\ckconfig.jsp. There was also another folder ckeditor_diffs for which the purpose is unclear.

Thanks to Hitoshi for the hint regarding CK editor.

Regards,
Ashok