Add JCE editor into K2 extra fields

Thursday, 14 March 2013

Many people may find K2 component of Joomla now does not have JCE editor, TinyMCE and other 3rd party editors in its extra fields. K2 now is using NicEdit, which does not have many functions like DocMan link.

According to the announcement of K2, this was for forbid a potential unstablility of K2. The guys at K2 say they have not included the JCE editor as it causes some kind of performance issues if multiple instances are used - "because there were conflicts calling multiple times the default editor set in Joomla, be it TinyMCE, JCE or whatever. So we added NicEdit to avoid these issues.". However, we provide a hack solution here to add JCE into K2. Please use it carefully and backup your code of K2 first before you do any change.

The version we tested is K2 v2.4.1. In the file: /administrator/components/com_k2/models/extrafield.php at line 208, replace:

if($active[1]){
    $output='id.'" id="K2ExtraField_'.$extraField->id.'" rows="10" cols="40" class="k2ExtraFieldEditor">'.$active[0].'';
}

with

if($active[1]){
    $editor =& JFactory::getEditor();
    $output = $editor->display("K2ExtraField_".$extraField->id."", $active[0], '550', '400', '60', '20', false);
}

If you meet any problem or have any question, please feel free to contact us.

 

Comments

Thanks for this post. I just had a Joomla 1.5 with K2 2.4 having the same problem and the client was complaining about this. Do you guys has an idea what exactly "unstability" would have?

Thanks for your reply Jake. As K2 guys said "there were conflicts calling multiple times the default editor set in Joomla", which should be a JS conflict on the interface, causing possible saving/applying problem in the backend.

Add new comment

Filtered HTML

  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Target Image

Recently posted

  • We are going to lunch a new extension of Chrome here for web proxy that works with Twitter, Facebook and Youtube. 1 year 11 months ago
  • Pluton - Free Single Page Bootstrap Html Template http://t.co/ADhr6O0qGs 1 year 11 months ago
  • Thanks Michael 1 year 11 months ago

Get a quote now

Don't deply your growing business. Contact us today to find out what we can help.

If you’re considering outsourcing your project development, need to update an existing website or simply need some good advice from someone who listens, get in touch with JoomlaCreator today.