View Single Post
  #50  
Old 09-27-2009, 11:02 PM
 
benz benz is offline
 

Senior Member
  
Join Date: Oct 2007
Posts: 111
 

Default Re: Adding the FCKeditor HTML Editor

The latest release of FCKeditor has been renamed to CKEditor, its a nice upgrade from the old one - one nice feature is that the textarea by default is resizeable, so passing in height and width parameters to the editor instance isn't always needed anymore.

When installing it the invocation process has changed a little bit. Follow the instructions at the start of this thread for downloading and installing on your server, using ckeditor instead of fckeditor for filepaths.

Now when you want to turn a textarea into an editor the javascript is different - there are 2 ways you do this.

1. Similar to the original method, insert some javascript after the textarea but with a new syntax eg for the skin1/main/product_details.tpl changes you would now use
Code:
{if $active_modules.FCKEditor ne ""} <script type="text/javascript"> CKEDITOR.replace('descr'); CKEDITOR.replace('fulldescr'); </script> {/if}
You can also customise the editor as you call it, read this article for more http://docs.fckeditor.net/CKEditor_3.x/Developers_Guide/Toolbar

2. Add the "ckeditor" class any text area you want to use as an editor. This is my preferred method, you can either edit the textarea.tpl file to always have this class, or just add it in for only the textareas that need it (which is what I do, it can be a bit dangerous adding it everywhere!). To add it in just to the full description field on a product page look in skin1/main/product_details.tpl for this line
Code:
{include file="main/textarea.tpl" name="fulldescr" cols=45 rows=12 class="InputWidth" data=$product.fulldescr width="80%" btn_rows=4}

and add in the ckeditor class as follows
Code:
{include file="main/textarea.tpl" name="fulldescr" cols=45 rows=12 class="InputWidth ckeditor" data=$product.fulldescr width="80%" btn_rows=4}

WARNING: Ckeditor is still in its early days, one feature that doesn't yet work out of the box with this new version is the image/file uploading - from what I can gather this is scheduled for release around December 2009. In the interim if you want to upload images with the new version you can purchase a plugin from them or write your own upload script for it. I think I'll be waiting
__________________
Version 4.1.8
Version 4.1.11
Reply With Quote