Archive

Posts Tagged ‘fckeditor’

Write in 9 Indian Scripts in Joomla using TinyMCE and FCKEditor Plugin

January 23rd, 2010 15 comments

Today I am going to explore various ways to easily type in Indian languages like Bengali, Gujarati, Hindi, Marathi, Sanskrit, Kannada, Malayalam, Oriya, Punjabi, Tamil and Telugu very easily in your favourite CMS Joomla.

There are 3 methods you can use depending on your editor choice.

  1. Using JCE Editor
  2. Using FCKEditor
  3. Using TinyMCE editor

Using JCE Editor

You have to first install JCE Editor along with plugins. It is assumed that JCE editor is your default editor. You can check/set it by going to Administration > Site menu > Global Configuration and look for Default WYSIWYG Editor.

  1. Download IndicIME plugin for TinyMCE and put it at WEBROOT\plugins\editors\jce\tiny_mce\plugins so that “indicime” will become sub-folder of plugins.
  2. Now navigate to Administration > Components > JCE Administration > Plugins. Click on “New Plugin” button on the right side.
  3. Fill in the form as described below and “Save” the plugin.
    Description: IndicIME
    Plugin Name: indicime
    Plugin Icon: indicime,indicimehelp
    Layout Icon: indicimehelp

  4. Now navigate to Administration > Components > JCE Administration > Groups. Select the Group(For ex. Default). Go to Layout tab and you will see a button as indicated in image with red square. You can drag this button and drop it in Current Editor Layout anywhere you like and “Save” it.
  5. Now clear browser cache (It is very important) and try to add new article. IndicIME and IndicIME help buttons will show up.
  6. Enjoy typing in Indian languages.

Using FCKEditor

You have to first download FCKEditor for Joomla and install this plugin. It is assumed that FCKEditor is your default editor. You can check/set it by going to Administration > Site menu > Global Configuration and look for Default WYSIWYG Editor.

  1. Download IndicIME plugin for FCKEditor and put it at WEBROOT\plugins\editors\fckeditor\editor\plugins so that “indicime” will become sub-folder of plugins.
  2. Now browse to WEBROOT\plugins\editors\fckeditor\editor and open the file “jtoolbarsetconfig.xml”
  3. At the very bottom, you will get “customplugins” node. Add the following line at the end.
    <add name="indicime" lang="en"/>

    So it will look like this.

  4. Now when you analyze this xml file, you will notice that it contains button list for three types of toolbars named “Advanced”, “Creative” and “Blog”. In each of these toolbars, you may want to add the IndicIME so find a good place to paste the following code as shown in the image.
    <plugingroup>
    <plugin name="indicime" acl="*">
    <params>
    <param name="IndicIMEScripts" value="My Bengali:bengali;My Gujarati:gujarati;My Devnagari: devnagari" />
    </params>
    </plugin>
    <plugin name="indicimehelp" acl="*"/>
    </plugingroup>

    Using this code, you will be able to customize the language list. If you don’t want to customize the list, remove the text “<params>…</params>”.(Make sure it is “<params>” and not “<param>”)

  5. Now clear browser cache (It is very important) and try to add new article. IndicIME and IndicIME help buttons will show up.
  6. Enjoy typing in Indian languages.

Using TinyMCE Editor

It is assumed that TinyMCE editor is your default editor. You can check/set it by going to Administration > Site menu > Global Configuration and look for Default WYSIWYG Editor.

  1. Download IndicIME plugin for TinyMCE and put it at WEBROOT\plugins\editors\tinymce\jscripts\tiny_mce\plugins so that “indicime” will become sub-folder of plugins.
  2. Now from Administration menu, navigate to Extensions > Plugins > Editor – TinyMCE.
  3. On the right hand side, Open the section “Plugin Parameters” and choose “Extended” Functionality.
  4. Now open the section “Advanced Parameters” and at the very bottom, add “indicime” custom plugin and “indicime,indicimehelp” custom button.
  5. Now when you try to add new article, it will show you IndicIME and IndicIME Help.
  6. Enjoy typing in Indian languages.

Limitation of using TinyMCE is that if you want to customize the list of languages, you need to change php code heavily.

Write in 9 Indian Scripts in Drupal 6 using TinyMCE and FCKEditor Plugin

December 22nd, 2009 7 comments

Here is a procedure on how to enable Drupal 6 to write in Indian language Bengali / Gujarati / Hindi / Marathi / Sanskrit / Kannada / Malayalam / Oriya / Punjabi / Tamil and Telugu.

Prerequisite:

  1. Download Wysiwyg project and install it at WEBROOT\sites\all\modules\wysiwyg. Enable this module by navigating to Administer > Site Building > Modules.
  2. Download TinyMCE / FCKEditor and install it at WEBROOT\sites\all\libraries\tinymce(/fckeditor).

There are two ways to enable Drupal 6 to allow user to type in Indian scripts.

  1. Using TinyMCE
  2. Using FCKEditor

Both are equally capable with almost same functionality but it is just a matter of personal choice which one to use.

Using FCKEditor

  1. Download IndicIME plugin for FCKEditor and put it at WEBROOT\sites\all\libraries\fckeditor\editor\plugins so that “indicime” will become sub-folder of plugins
  2. Open the file WEBROOT\sites\all\modules\wysiwyg\editors\fckeditor.inc in text editor
  3. Copy/paste following code at the very bottom in the function wysiwyg_fckeditor_plugins.
    'indicime' => array(
          'path' => $editor['library path'] . '/editor/plugins',
          'buttons' => array(
            'indicime' => t('IndicIME'),
            'indicimehelp' => t('IndicIME Help'),
          ),
          'options' => array (
            'IndicIMEScripts' => t('My Bengali:bengali;My Gujarati:gujarati;My Devanagari:devanagari;English (F12):english'),
          ),
          'internal' => TRUE,
          'load' => TRUE,
        ),
  4. If you want all scripts to be shown, remove “options” line from the above code. “options” is given to show you easy customization of list.
  5. Now navigate to Administer > Site Configuration > Wysiwyg.
  6. For “Filtered HTML” and “Full HTML” input format, select “FCKEditor” and “Save”.
  7. After saving, you will be shown an option for “Edit” for each input format.
    fckinputformat
  8. Click on “Edit” and open section “Buttons and Plugins”. Select “IndicIME” and “IndicIME Help” button for both input format and “Save”.
    indicimebutton
  9. Now navigate to Create Content > Page, you will get Indic IME drop down box for choosing language and help button to show keyboard.fckindicime
  10. Enjoy typing in your own language.

Using TinyMCE

  1. Download IndicIME plugin for TinyMCE and put it at WEBROOT\sites\all\libraries\tinymce\jscripts\tiny_mce\plugins so that “indicime” will become sub-folder of plugins
  2. Open the file WEBROOT\sites\all\modules\wysiwyg\editors\tinymce.inc in text editor
  3. Copy/paste following code at the very bottom in the function wysiwyg_tinymce_plugins.
    'indicime' => array(
            'path' => $editor['library path'] .'/plugins/indicime',
            'buttons' => array(
              'indicime' => t('IndicIME'),
              'indicimehelp' => t('IndicIME Help')
            ),
            'options' => array (
              'indicime_scripts' => t('My Bengali:bengali;My Gujarati:gujarati;My Devanagari:devanagari;English (F12):english')
            ),
            'internal' => TRUE,
            'load' => TRUE,
             ),
  4. If you want all scripts to be shown, remove “options” line from the above code. “options” is given to show you easy customization of list.
  5. Now navigate to Administer > Site Configuration > Wysiwyg.
  6. For “Filtered HTML” and “Full HTML” input format, select “TinyMCE” and “Save”.
  7. After saving, you will be shown an option for “Edit” for each input format.
    IndicIME for TinyMCE with Drupal
  8. Click on “Edit” and open section “Buttons and Plugins”. Select “IndicIME” and “IndicIME Help” button for both input format and “Save”.
    indicimebutton
  9. Now navigate to Create Content > Page, you will get Indic IME drop down box for choosing language and help button to show keyboard.IndicIME for TinyMCE with Drupal
  10. Enjoy typing in your own language.

Update 4th Jan, 2009: I have added code to customize the list of scripts for TinyMCE and FCKEditor. Thanks to Ramana.

FCKEditor JSP Integration Error: The server didn’t send back a proper XML response

April 8th, 2009 No comments

I was having problem to integrate FCKEditor into struts 1.3. I tried to do it as per instruction in the JSP Integration method given on FCKEditor documentation but still I was not able to run it locally. Here is how I installed struts 1.3.

http://localhost/jsptest (Tomcat is running on the top of apache)

FCKEditor file is installed at http://localhost/jsptest/js/fckeditor/…..

Please note that I have put fckeditor under /js directory so I have to change the path in all files listed below from what documentation says. If you have your fckeditor installed in other directory, make necessary changes in the files mentioned below to represent your actual path.

Error Description:

The server didn’t send back a proper XML response

Resolution:

  1. Open fckconfig.js file. Locate “var _FileBrowserLanguage = ‘xxx’;var _QuickUploadLanguage=’xxx’;”. Make sure you put xxx = jsp. This change is needed because I had this value as “php” so apache was delegating the request to php engine and it was throwing error as file not found but if I change it to “jsp”, now apache will delegate the request to Tomcat and it knows from web.xml file how to process this request.
  2. Create a file under WEBROOT/WEB-INF/classes/fckeditor.properties if not exists and put following text
    fckeditor.basePath=/js/fckeditor
    connector.userFilesPath=/images
    connector.resourceType.image.path=/
    connector.resourceType.file.path=/
    connector.resourceType.flash.path=/
    connector.resourceType.media.path=/
  3. Make sure you have connector defined in web.xml file.
    <servlet>
    	<servlet-name>Connector</servlet-name>
    	<servlet-class>net.fckeditor.connector.ConnectorServlet</servlet-class>
    	<load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    	<servlet-name>Connector</servlet-name>
    	<!-- Do not wrap this line otherwise Glassfish will fail to load this file -->
    	<url-pattern>/js/fckeditor/editor/filemanager/connectors/*</url-pattern>
    </servlet-mapping>
Categories: JSP Tags: , , ,