Contributions
CKEditor osC 2.3.1
English_______________
Very good editor wyswyg and more modern than tinyMCE and FCKEditor for osCommerce 2.3.1.
Added screenshot
Español______________
Editor wyswyg muy bueno y más moderno que tinyMCE y FCKEditor para osCommmerce 2.3.1
Añadido screenshot
FULL PACKAGE
Expand All / Collapse All
If CKEditor is showing the HTML code when you go to edit text that has already been formatted, make the following change to the html_output.php file in the admin/functions directory.
Find:
} elseif (tep_not_null($text)) {
$field .= tep_output_string_protected($text);
}
Note: Attached file is empty
Replace with:
} elseif (tep_not_null($text)) {
$field .= $text;
}
A correction only to the description displayed here so it works if you copy and paste (sql in step 3).
All credit to scchristie
A slightly more elegant solution is listed below which utilises the new embedded jQuery functionality to create the CKeditor box on the fly after page load.
Doing it this way creates a CKEditor field for product descriptions and newletters and should also work with most contributions that use the textarea field.
CKEditor can be switched on and off in Configuration->My Store. The configuration query which adds this can be added manually with phpMyAdmin or similar if desired.
I wouldn't recommend using this on the catalog side as there is the possibility of leaving potentially unpatched attack vectors if you do not keep up to date with new releases of CKEditor.
1. Download the latest CKEditor from http://ckeditor.com/download and unpack to catalog/admin/ext/ckeditor - ckeditor.js should now be in the top level of this folder. CKeditor 3.5 (released December 17th, 2010) is included in this zip but please check for a newer version before install.
2. Open /catalog/admin/includes/functions/html_output.php and change the tep_draw_textarea_field (around line 252) to read:
$field = '<textarea name="' . tep_output_string($name) . '" id="' . tep_output_string($name) . '" cols="' . tep_output_string($width) . '" rows="' . tep_output_string($height) . '"';
3. Open /catalog/admin/includes/template_top.php and add the following before the </head> tag:
<?php
if (!defined('USE_CKEDITOR_ADMIN_TEXTAREA')) {
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, set_function) values ('', 'Use CKEditor', 'USE_CKEDITOR_ADMIN_TEXTAREA','true','Use CKEditor for WYSIWYG editing of textarea fields in admin',1,99,now(),'tep_cfg_select_option(array(\'true\', \'false\'),' )");
define ('USE_CKEDITOR_ADMIN_TEXTAREA','true');
}
if (USE_CKEDITOR_ADMIN_TEXTAREA == "true") {
?>
<script type="text/javascript" src="<?php echo tep_href_link('ext/ckeditor/ckeditor.js'); ?>"></script>
<script type="text/javascript" src="<?php echo tep_href_link('ext/ckeditor/adapters/jquery.js'); ?>"></script>
<script type="text/javascript">
$(function() {
var $editors = $('textarea');
if ($editors.length) {
$editors.each(function() {
var editorID = $(this).attr("id");
var instance = CKEDITOR.instances[editorID];
if (instance) { CKEDITOR.remove(instance); }
CKEDITOR.replace(editorID);
});
}
});
</script>
<?php
}
?>
4. All installed - just visit your admin site.
A slightly more elegant solution is listed below which utilises the new embedded jQuery functionality to create the CKeditor box on the fly after page load.
Doing it this way creates a CKEditor field for product descriptions and newletters and should also work with most contributions that use the textarea field.
CKEditor can be switched on and off in Configuration->My Store. The configuration query which adds this can be added manually with phpMyAdmin or similar if desired.
I wouldn't recommend using this on the catalog side as there is the possibility of leaving potentially unpatched attack vectors if you do not keep up to date with new releases of CKEditor.
1. Download the latest CKEditor from http://ckeditor.com/download and unpack to catalog/admin/ext/ckeditor - ckeditor.js should now be in the top level of this folder. CKeditor 3.5 (released December 17th, 2010) is included in this zip but please check for a newer version before install.
2. Open /catalog/admin/includes/functions/html_output.php and change the tep_draw_textarea_field (around line 252) to read:
$field = '<textarea name="' . tep_output_string($name) . '" id="' . tep_output_string($name) . '" cols="' . tep_output_string($width) . '" rows="' . tep_output_string($height) . '"';
3. Open /catalog/admin/includes/template_top.php and add the following before the </head> tag:
<?php
if (!defined('USE_CKEDITOR_ADMIN_TEXTAREA')) {
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, set_function) values ('', 'Use CKEditor', 'USE_CKEDITOR_ADMIN_TEXTAREA','true','Use CKEditor for WYSIWYG editing of textarea fields in admin',1,99,now(),'tep_cfg_select_option(array('true', 'false'),' )");
define ('USE_CKEDITOR_ADMIN_TEXTAREA','true');
}
if (USE_CKEDITOR_ADMIN_TEXTAREA == "true") {
?>
<script type="text/javascript" src="<?php echo tep_href_link('ext/ckeditor/ckeditor.js'); ?>"></script>
<script type="text/javascript" src="<?php echo tep_href_link('ext/ckeditor/adapters/jquery.js'); ?>"></script>
<script type="text/javascript">
$(function() {
var $editors = $('textarea');
if ($editors.length) {
$editors.each(function() {
var editorID = $(this).attr("id");
var instance = CKEDITOR.instances[editorID];
if (instance) { CKEDITOR.remove(instance); }
CKEDITOR.replace(editorID);
});
}
});
</script>
<?php
}
?>
4. All installed - just visit your admin site.
http://www.oscommerce.com/contributions/CKEditor-osC-2.3.zip
changes to de3 during maintenance for all new files overnight just change to www. and it will work
English_______________
Very good editor wyswyg and more modern than tinyMCE and FCKEditor for osCommerce 2.3.1.
Added screenshot
Español______________
Editor wyswyg muy bueno y más moderno que tinyMCE y FCKEditor para osCommmerce 2.3.1
Añadido screenshot
FULL PACKAGE
Note: Contributions are used at own risk.