Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * * * 1 votes

[Contribution] CKEditor [wyswyg]


82 replies to this topic

#1 www.in.no

  • Community Member
  • 235 posts
  • Real Name:Arild Evensen

Posted 29 January 2010, 10:54

Support tread for CKEditor [wyswyg]

Contribution can be found here.

CKEditor

Thanks goes to escri2 for adding this contribution and make it working in other contribution.

I create this forum tread where we can discuse and helteach other to integrate this editor into more contribution. I am not a coding guru, but together we may be able to get this cotribution to work with the major contribs where a wyswyg editor is needed.

Today it is used in theese contribution / functions.

Information Pages Unlimited v2.07 -> Link

Products descriptions. (instructions in CKEditor contribution.)


It is a greate editor buildt on and replaceing the old FCKEditor.


There is still some functions that can be improved / added.

-File / image uplade function.
-Image browsing.
-Needed code change to other contribution.
-Function to not load javascript if not needed. (same function as for tinyMCE)
- Adjust ckeditor pack fore OSC. Remove unneeded files in pack.
- Configuration changes to better work in OSC
-??


If you have this contribution installed and/or got it working with other contribution and want to help. Please post the code changes here or make a uplod to the contribution page with instruction.

#2 www.in.no

  • Community Member
  • 235 posts
  • Real Name:Arild Evensen

Posted 29 January 2010, 12:34

Have added package to only load javascript when needed.
Only need to replace the javascript line for ckeditor.
Easy to modify.

#3 www.in.no

  • Community Member
  • 235 posts
  • Real Name:Arild Evensen

Posted 29 January 2010, 17:05

Have added the option to turn ckeditor on or of from admin.

#4 azer

  • Community Member
  • 842 posts
  • Real Name:azer
  • Location:Paris, france

Posted 02 February 2010, 23:55

can someone please make an installation manual to know the modification to make to the ckeditor taken from their website
i managed to instal all FCKeditor version but CK editor i really different
MS2

#5 designbysue

  • Community Member
  • 237 posts
  • Real Name:Sue Young

Posted 03 February 2010, 13:47

I am trying to add the code to turn the editor on and off in admin per the contribution page which states:

Run this query in phpmyadmin. You can modyfy where you want this option listed. The groupe_id is for the configuration groupe in admin - configuration. No 1 is "My Store". The "sort order" is where in the list this will be added. For me no. 22 was the next availeble sort order under group_id = 1.
Changes to fit your store.


INSERT INTO `configuration` ( `configuration_id` , `configuration_title` , `configuration_key` , `configuration_value` , `configuration_description` , `configuration_group_id` , `sort_order` , `last_modified` , `date_added` , `use_function` , `set_function` )
VALUES (
'', 'Use CKEditor', 'CKEditor_use', 'false', 'Select if you want to use CKEditor or not', 1, , '', '', NULL , 'tep_cfg_select_option(array(''true'', ''false''),'
)

when I run this SQL I get the folowing statement from phpmyadmin:

#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ' '', '', NULL , 'tep_cfg_select_option(array(''true'', ''false'

help please

Sue

Edited by designbysue, 03 February 2010, 13:52.


#6 designbysue

  • Community Member
  • 237 posts
  • Real Name:Sue Young

Posted 03 February 2010, 13:59

The editor is showing up in the Categories/Product area but the area is only about a inch and a half wide.

Screen shot here [img]http://www.paintballwarehouseny.com/editor-screen-shot.jpg[/img]

How does one widen this to a usable condition?

Sue

#7 designbysue

  • Community Member
  • 237 posts
  • Real Name:Sue Young

Posted 03 February 2010, 14:33

Sorry - one more thing - the editor is showing up as stated but the original oscommerce product description area is still below the editor area. I would like the editor to replace the original oscommerce input area.

Also - I see the editor window can be sized, but I would rather it open in a larger state rather than have tod the extra mouse movements every time editing is needed.

Sue

Edited by designbysue, 03 February 2010, 14:34.


#8 www.in.no

  • Community Member
  • 235 posts
  • Real Name:Arild Evensen

Posted 03 February 2010, 15:13

I think this may because of a missing ; at the end.

try this

INSERT INTO `configuration` ( `configuration_id` , `configuration_title` , `configuration_key` , `configuration_value` , `configuration_description` , `configuration_group_id` , `sort_order` , `last_modified` , `date_added` , `use_function` , `set_function` ) 
VALUES (
'', 'Use CKEditor', 'CKEditor_use', 'false', 'Select if you want to use CKEditor or not', 1, , '', '', NULL , 'tep_cfg_select_option(array(''true'', ''false''),'
);


The with of the editor windows i have not figured out yet as it has not been that annoying yet..


To remove the extra old textarea window, you must remove some duplicate code in the categories.php file.

Here i have commented out the old code. Remove it or comment out.

         <tr>
            <td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td>
            <td><table border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td class="main" valign="top"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?>&nbsp;</td>
                <td class="main">
<?php echo tep_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '70', '10',
(isset($products_description[$languages[$i]['id']]) ? stripslashes($products_description[$languages[$i]['id']]) :
tep_get_products_description($pInfo->products_id, $languages[$i]['id'])),'id = products_description[' .
$languages[$i]['id'] . '] class="ckeditor"'); ?>
<!-- /*** old code  <?php echo tep_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_description[$languages[$i]['id']]) ? stripslashes($products_description[$languages[$i]['id']]) : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?>
 ***/ //-->
</td>
              </tr>

Edited by www.in.no, 03 February 2010, 15:15.


#9 www.in.no

  • Community Member
  • 235 posts
  • Real Name:Arild Evensen

Posted 03 February 2010, 15:35

To set the with of the window add this in tge config.js file in the ckeditor folder.

config.width = 850;
or
config.width = '75%';

Change to the value you want.

#10 designbysue

  • Community Member
  • 237 posts
  • Real Name:Sue Young

Posted 03 February 2010, 19:33

The config.width worked great.

Here is the code I have - what am I to comment out (can't find exactly what you posted)

<tr>
<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td class="main"><?php echo TEXT_PRODUCTS_MANUFACTURER; ?></td>
<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, $pInfo->manufacturers_id); ?></td>
</tr>
<tr>
<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<?php
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
?>
<tr><!-- BOF code adapted CKEditor by escri2 -->
<td class="main" valign="top" colspan="2" align="left"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td>
</tr>
<tr>
<td colspan="2"><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="main" valign="top"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?>&nbsp;</td>
<td class="main">
<?php echo tep_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '70', '10', (isset($products_description[$languages[$i]['id']]) ? stripslashes($products_description[$languages[$i]['id']]) : tep_get_products_description($pInfo->products_id, $languages[$i]['id'])),'id = products_description[' . $languages[$i]['id'] . '] class="ckeditor"'); ?>
</td>
</tr><!-- EOF code adapted CKEditor by escri2 -->
</table></td>
</tr>
<?php
}
?>
<tr>
<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr bgcolor="#ebebff">
<td class="main"><?php echo TEXT_PRODUCTS_TAX_CLASS; ?></td>
<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id, 'onchange="updateGross()"'); ?></td>
</tr>
<tr bgcolor="#ebebff">
<td class="main"><?php echo TEXT_PRODUCTS_PRICE_NET; ?></td>
<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_price', $pInfo->products_price, 'onKeyUp="updateGross()"'); ?></td>
</tr>
<tr bgcolor="#ebebff">
<td class="main"><?php echo TEXT_PRODUCTS_PRICE_GROSS; ?></td>
<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_price_gross', $pInfo->products_price, 'OnKeyUp="updateNet()"'); ?></td>
</tr>
<tr>
<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<script language="javascript"><!--
updateGross();
//--></script>
<?php
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
?>
<tr>
<td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td>
<td><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="main" valign="top"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?>&nbsp;</td>
<td class="main"><?php echo tep_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_description[$languages[$i]['id']]) ? stripslashes($products_description[$languages[$i]['id']]) : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?></td>
</tr>
</table></td>
</tr>
<?php
}
?>
<tr>

Sue

Edited by designbysue, 03 February 2010, 19:37.


#11 www.in.no

  • Community Member
  • 235 posts
  • Real Name:Arild Evensen

Posted 03 February 2010, 19:44

Check the last bit of code, you will find the duplicate code there. It looks like it is edited with some other contribution.
You will have to edit out and merge it to one instanse.

<script language="javascript"><!--
updateGross();
//--></script>
<?php
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
?>
<tr>
<td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td>
<td><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="main" valign="top"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?>&nbsp;</td>
<td class="main"><?php echo tep_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_description[$languages[$i]['id']]) ? stripslashes($products_description[$languages[$i]['id']]) : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?></td>
</tr>
</table></td>
</tr>
<?php
}
?>
<tr>


#12 designbysue

  • Community Member
  • 237 posts
  • Real Name:Sue Young

Posted 03 February 2010, 20:05

I copied this code from the contribution (admin>categories.php

<tr><!-- BOF code adapted CKEditor by escri2 -->
<td class="main" valign="top" colspan="2" align="left"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td>
</tr>
<tr>
<td colspan="2"><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="main" valign="top"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?>&nbsp;</td>
<td class="main">
<?php echo tep_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '70', '10', (isset($products_description[$languages[$i]['id']]) ? stripslashes($products_description[$languages[$i]['id']]) : tep_get_products_description($pInfo->products_id, $languages[$i]['id'])),'id = products_description[' . $languages[$i]['id'] . '] class="ckeditor"'); ?>
</td>
</tr><!-- EOF code adapted CKEditor by escri2 -->
</table></td>

is the error in here? If so - how can I correct it. I have used Beyond Compare and I don't see where any other contribution clashes with this.

Sue

#13 designbysue

  • Community Member
  • 237 posts
  • Real Name:Sue Young

Posted 03 February 2010, 21:18

Actually there is a larger problem - the window has replaced the product name instead of the description!!!

I have to remove this at this point because client is coming tomorrow see the back end of the cart. But if anyone can tell me how to make this work it would be appreciated!!!

Sue

#14 designbysue

  • Community Member
  • 237 posts
  • Real Name:Sue Young

Posted 03 February 2010, 21:38

OK - I found the problem - the categories.php in the installation is not correct!!!! - I appreciate your posting the code here so I could cut and paste. The directions for this install are a pdf which doesn't allow for copying, searching and pasting. I suggest the creators of this contribution make the instructions as a text file to make the upgrade much easier and also that they look at the included file of categories.php because I followed it through Beyond Compare and it replaced my products name!!1

Thanks for your help

Sue

#15 www.in.no

  • Community Member
  • 235 posts
  • Real Name:Arild Evensen

Posted 03 February 2010, 22:18

The instructions are not that complicated so i will se if i can copy it out and post it as a text file in the contrib page. You can cut and past from the pdf with the right software.

#16 sunrise99

  • Community Member
  • 139 posts
  • Real Name:David

Posted 06 February 2010, 06:03

View Postwww.in.no, on 03 February 2010, 22:18, said:

The instructions are not that complicated so i will se if i can copy it out and post it as a text file in the contrib page. You can cut and past from the pdf with the right software.

Hi,
Now default CKEditor don't support image upload, need CKEfinder install, would you please help to how to make CKEditor can work with CKEfinder together?

Best Regards,
Sunrise99

#17 www.in.no

  • Community Member
  • 235 posts
  • Real Name:Arild Evensen

Posted 06 February 2010, 08:34

CKfinder is a comercial product and i am not sure if we can include it in oscommerce.

But it is availeble to install in demo mode, and i can outline the steps to get it working.

1. Upload ckfinder to the admin folder.

2. Add this line to ckeditor/config.js
CKFinder.SetupCKEditor( null, '../admin/ckfinder/' );

3. Add the path to the 2 variables (baseUrl and baseDir) in config.php in ckfinder directory.
$config['LicenseName'] = '';
$config['LicenseKey'] = '';
$baseUrl = 'http://xxx.yy.no/';
$baseDir = '/home/xxxx/public_html/';

Then the upload path will be to the images folder in your catalog directory.
The images folder name is set some other place in the file, but no need to change.

4. You may also add the _thumbs directory within the images folder.


This is for images only, for uploading flash files a seperate config has to be set. I havent looked into that yet as i am not using flash at my site.

I had some folder problems when testing, so you may need to read your server log to se that the path and folders are correct.

#18 blr044

  • Community Member
  • 1,009 posts
  • Real Name:Bennett
  • Gender:Male
  • Location:USA

Posted 08 February 2010, 22:16

I have uploaded ones of Nic's template ver Rc2a and he has added the FCK WYSIWYG contribution. I can edit pages but am having problems when I want to add images. At admin, it states it is ver 2.6. Whenever I tick insert image, the popup opens but with an error. The error is telling me the path is incorrect. /home/user/html_public/catalog/admin/.../.....

I do not see the the mod in list of contributions so as that I may be able to read any docs. Because I know it must be a config file, but no such file in directory. When I open in contribution FCK WYSIWYG it points CKEditor.

See an earlier post where a member stated he wanted FCK but got CKEditor instead. Would that be depending on the ver downloaded?

Any comments or suggestions on this is appreciated.

Bennett

#19 www.in.no

  • Community Member
  • 235 posts
  • Real Name:Arild Evensen

Posted 09 February 2010, 14:06

FCKeditor is the old version and is still in use with oscommerce and have it's own supporttred. CKEditor is a new name for the old FCKeditor.

This support tread is for CKEditor and what you will choose to use is up to you. CKEditor is easy to use and install, but still not having the code for using with all addons as you more likly will find for FCKeditor or tinyMCE.

#20 designbysue

  • Community Member
  • 237 posts
  • Real Name:Sue Young

Posted 09 February 2010, 15:05

View Postwww.in.no, on 03 February 2010, 15:13, said:

I think this may because of a missing ; at the end.

try this

INSERT INTO `configuration` ( `configuration_id` , `configuration_title` , `configuration_key` , `configuration_value` , `configuration_description` , `configuration_group_id` , `sort_order` , `last_modified` , `date_added` , `use_function` , `set_function` ) 
VALUES (
'', 'Use CKEditor', 'CKEditor_use', 'false', 'Select if you want to use CKEditor or not', 1, , '', '', NULL , 'tep_cfg_select_option(array(''true'', ''false''),'
);



This code still does not run - I get the following error message"

#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ' '', '', NULL , 'tep_cfg_select_option(array(''true'', ''false'

Sue