Post by jcmarchi » Mon Oct 17, 2011 9:47 am

Hello guys,

For a while I've been missing some features in the CK Editor (the WYSIWYG editor used on OpenCart), such as Find & Replace, View Tags, etc... After a while trying to pretend those features (and other) won't matter, the lack of those capabilities that should be there by default got so annoying that I've decided to "fix" it once and for all. ;D

As I don't like to change original files, my first attempt was to create a VQMod XML file for that, but for some reason it didn't work (neither generate any error)... I suppose VQMods cannot be used to fix/change/hack CSS and JS files, and so the only other solution was to edit the original file. :-[

If someone know how to make VQMod XML files work with CSS and JS please let me know how. ???

Anyway, for the hard coded fix (hack), here is how you can do it:

Open your admin/view/javascript/ckeditor/config.js and find the line (probably line 26):

Code: Select all

config.toolbar = 'Custom';
Replace it with the following code:

Code: Select all

	config.toolbar = 'Best';

	config.toolbar_Best = [
		['Source','ShowBlocks','-','Maximize','Preview'],
		['Save','-','NewPage','Templates'],
		['Undo','Redo','-','Cut','Copy','Paste','PasteText','PasteFromWord','-','Print','SpellChecker','Scayt'],
		['Find','Replace','-','SelectAll','RemoveFormat'],
		'/',
		['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
		['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
		['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
		['Link','Unlink','Anchor'],
		['Image','Flash','-','Table','HorizontalRule','PageBreak','-','SpecialChar','Smiley'],
		'/',
		['Styles','Format','Font','FontSize'],
		['TextColor','BGColor']
	];
Do not change anything else. Leave the rest untouched (you are simply adding a new custom toolbar and making it as default with the command config.toolbar = 'Best';.

Save the file and enjoy now a Full Featured Editor. ;D

Important Note: I've left the 'Styles' and 'Format' enabled because on my installation it worked fine. If it doesn't work for you simply change the line:

Code: Select all

['Styles','Format','Font','FontSize'],
to:

Code: Select all

['Font','FontSize'],
I hope it helps other to be more productive on a daily basis.

This "hack" should be "compatible" with any OpenCart vesion that uses the CK Editor version 3.0 or newer (maybe it will work for older versions too, but I haven't tested it).

Please notice those changes will affect the CK Editor globally (Product, Catalog, Mail, etc)... Which, IMO, is a good thing! 8)

Enjoy it!

Julio Marchi
jcmarchi@gmail.com

Newbie

Posts

Joined
Thu Oct 13, 2011 9:34 am

Post by MrTech » Fri Feb 24, 2012 1:18 pm

Works as advertised on my opencart 1.5.1.3 installation.

Thanks for sharing!

~
Install Extensions OR OpenCart Fast Service! PayPal Accepted
I will professionally install and configure any free or purchased theme, module or extension.

Visit http://www.mrtech.ca if you need an OpenCart webmaster
~


User avatar
Active Member

Posts

Joined
Mon Jan 09, 2012 2:39 pm
Location - Canada, Eh!

Post by terrynshed » Tue Mar 13, 2012 5:00 am

Thanks for the mod. It is something I have been looking for. I am also running 1.5.1.3, but can not seem to get it to work. Below is the code I installed into the config.js file.

Code: Select all

	// config.toolbar = 'Custom';
	
	// New code start;
	
	 config.toolbar = 'Best';

  	 config.toolbar_Best = [
      		['Source','ShowBlocks','-','Maximize','Preview'],
      		['Save','-','NewPage','Templates'],
      		['Undo','Redo','-','Cut','Copy','Paste','PasteText','PasteFromWord','-','Print','SpellChecker','Scayt'],
      		['Find','Replace','-','SelectAll','RemoveFormat'],
      		'/',
      		['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
      		['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
      		['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
      		['Link','Unlink','Anchor'],
      		['Image','Flash','-','Table','HorizontalRule','PageBreak','-','SpecialChar','Smiley'],
      		'/',
      		['Styles','Format','Font','FontSize'],
      		['TextColor','BGColor']
   		];
   
   	// New code end;
When I go into my admin section, the ckeditor still looks the same. Any ideas?

One thing I wanted to find out is if this mod will also spell check or at least point out any misspelled words.

Thanks

New member

Posts

Joined
Fri Jan 20, 2012 5:35 pm

Post by wendy2009 » Tue Mar 13, 2012 11:10 am

ImageI hope it helps other to be more productive on a daily basis.

Newbie

Posts

Joined
Tue Mar 06, 2012 11:36 am

Post by terrynshed » Wed Mar 14, 2012 4:53 am

I figured it out. Simply forgot to comment out the old code.

It is actually quite simple to configure and use which features you want of the CK Editor.

One thing I could not get to work was the AutoGrow feature. Seems like a nice thing to have so you can view all your text at once. I enabled it, set my min and max heights, but the window height does not change as you reach the end of the window.

I set the window height instead for now so I can see all my text, but I'll keep messing with the AutoGrow feature in hopes to get it working.

Thanks

New member

Posts

Joined
Fri Jan 20, 2012 5:35 pm

Post by rdvapors » Mon Dec 17, 2012 12:35 am

Well actually you don't need to do this. In 1.5.4 go to line 28 and change 'Custom' to 'Full' and reload the page. There you have it! Full with spell check.

Red Dragon Vapors
http://www.reddragonvapors.com
info@reddragonvapors.com

New member

Posts

Joined
Thu Dec 13, 2012 11:29 pm

Post by JNeuhoff » Mon Dec 17, 2012 1:01 am

jcmarchi wrote:I suppose VQMods cannot be used to fix/change/hack CSS and JS files, and so the only other solution was to edit the original file. :-[

If someone know how to make VQMod XML files work with CSS and JS please let me know how. ???
Quite easy: For example, if you have to change the 'stylesheet.css' via VQmod, do it like this:

1)
Create a VQmod script changing the common/header.tpl, such as:
<link rel="stylesheet" type="text/css" href="<?php echo $vqmod->modCheck('view/stylesheet/stylesheet.css'); ?>" />

2)
Create your VQmod script chaning the stylesheet.css

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by dbateson » Tue May 14, 2013 10:28 pm

hi,
this thread inspired me to write a vqmod extension to the expand ckeditor toolbar so it shouldnt be over written when you upgrade opencart. link is below, extension is free:
http://www.opencart.com/index.php?route ... n_id=11836

thanks
dave

Newbie

Posts

Joined
Tue May 14, 2013 10:25 pm

Post by dbateson » Tue May 14, 2013 10:32 pm

hi,

this thread inspired me to write a vqmod extension to expand the ckeditor toolbar so thought id post a link to it here. uses vqmod so shouldnt be overwritten when you upgrade opencart. link is below and its free:

http://www.opencart.com/index.php?route ... n_id=11836

thanks
dave

Newbie

Posts

Joined
Tue May 14, 2013 10:25 pm
Who is online

Users browsing this forum: No registered users and 10 guests