View Single Post
  #25  
Old 10-31-2008, 07:09 AM
 
shorelineoftahoe shorelineoftahoe is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 30
 

Default Re: Adding the FCKeditor HTML Editor

Just an FYI for language variables:

You can change all language variables to have the FCKeditor by inserting this:

<script type="text/javascript">
var oFCKeditor = new FCKeditor('var_{$lbl.name}');
oFCKeditor.BasePath = "../fckeditor/";
oFCKeditor.Height="200";
oFCKeditor.ToolbarSet="Default";
oFCKeditor.ReplaceTextarea() ;
</script>

Right before:
{/foreach}
<tr>
<td colspan="2" class="SubmitBox">

in skin1/admin/languages.tpl.

You can also get any new language variables to have the editor by inserting this:

<script type="text/javascript">
var oFCKeditor = new FCKeditor('new_var_value');
oFCKeditor.BasePath = "../fckeditor/";
oFCKeditor.Height="200";
oFCKeditor.ToolbarSet="Default";
oFCKeditor.ReplaceTextarea() ;
</script>

Right before:

</form>
{/capture}
{include file="dialog.tpl" content=$smarty.capture.dialog title=$lng.lbl_add_new_language extra='width="100%"'}

at the bottom of the same .tpl.

*HOWEVER* Adding FCKeditor to all language variables can drastically slow down a page's load time. I recommend only adding it for the language variables that really need it, like txt_welcome. Here's the initial info I inserted at the end of the form called languagespostform (around line 200, right before </form>):

<script type="text/javascript">
var oFCKeditor = new FCKeditor('var_txt_welcome');
var oFCKeditor = new FCKeditor('var_txt_conditions_customer');
var oFCKeditor = new FCKeditor('var_txt_privacy_statement');
oFCKeditor.BasePath = "../fckeditor/";
oFCKeditor.Height="200";
oFCKeditor.ToolbarSet="Default";
oFCKeditor.ReplaceTextarea() ;
</script>

I hope this helps someone else.
__________________
xcart v. 4.18-4.4
Reply With Quote