In this tutorial you will learn how to add KTML 4 as a rich text editor for the Jahia content management system.
In order to follow this tutorial you need:
An installed copy of the Jahia content management system.
The KTML4-Jahia zip build. You can find it inside the downloaded KTML 4 package, in the /documentation/CMS-Integration/Jahia.
Some knowledge of Java is recommended, but not mandatory.
A text editor.
To add KTML 4 as a rich text editor for Jahia, you need to make the required files available to Jahia, and then make Jahia aware of the editor by editing the configuration file.
First, copy the required files in place:
Copy the ktml4-jahia\jsp\jahia\htmleditors\ktml4 folder to <site_root>\tomcat\webapps\jahia\jsp\jahia\htmleditors\.
Note: Replace <site_root> with the path to the base Jahia folder.
Next you have to copy the KTML 4 libraries in Jahia: from the ktml4-jahia\WEB-INF\lib\ folder copy the commons-fileupload-1.0.jar, impakt.jar and ktml.jar files into the <site_root>\tomcat\webapps\jahia\WEB-INF\lib\ folder.
Next you have to make Jahia aware of the editor:
Open the <site_root>\tomcat\webapps\jahia\WEB-INF\etc\htmleditors\htmleditors_config.xml file with a text editor.
Add the following code after the <editors> opening tag, and before other <editor> tags:
<editor>
<id>ktml4</id>
<name>Ktml4</name>
<base-directory>ktml4</base-directory>
<include-file>ktml4_htmleditor.jsp</include-file>
<enable-css>false</enable-css>
<rank>4</rank>
</editor>
The code above specifies the editor name, main file and rank. If you want KTML 4 to be the default editor, set its rank to 1. Otherwise use another value, and it will be displayed in the drop-down menu atop of the editing area. Save the file and close it.
To test the integration of the new rich text editor, follow the next steps:
Start Jahia.
Login with a valid username and password:
After the credentials are checked and the user logged in, click the Edit tab on top of the page to switch to page editing mode:
Click on the icon next to the text on teh first page, and from the pop-up menu select Update:
If you have set the rank for the KTML 4 editor to 1 (meaning that it is set as the default editor), you will have to choose it from the drop-down menu displayed above the editing area. The default editor will switch and load the KTML Visual HTML editor.