Keyword

JCE editor in Extra Fields

  • yair abelson
  • yair abelson's Avatar Topic Author
  • Offline
  • New Member
More
11 years 3 months ago #115344 by yair abelson
JCE editor in Extra Fields was created by yair abelson
hi.
i've been trying to make JCE (or a similar editor) work in the Extra Fields' textarea field.
i've made the following change :
in
case 'textarea' :
    if ($active[1])
    {
        if ($required)
        {
        $attributes = 'class="k2ExtraFieldEditor k2Required"';
        }
    else
        {
        $attributes = 'class="k2ExtraFieldEditor"';
        }
    }
    $output = '<textarea name="K2ExtraField_'.$extraField->id.'" id="K2ExtraField_'.$extraField->id.'" rows="10" cols="40" '.$attributes.'>'.htmlspecialchars($active[0], ENT_QUOTES, 'UTF-8').'</textarea>';
break;

i replaced the section of
$output = '<textarea name="K2ExtraField_'.$extraField->id.'" id="K2ExtraField_'.$extraField->id.'" rows="10" cols="40" '.$attributes.'>'.htmlspecialchars($active[0], ENT_QUOTES, 'UTF-8').'</textarea>';
break;

with
$editor =& JFactory::getEditor();
$output = '<textarea name="K2ExtraField_'.$extraField->id.'" $editor->display("K2ExtraField_".$extraField->id."", '.$attributes.'>'.htmlspecialchars($active[0], ENT_QUOTES, 'UTF-8'), '550', '400', '60', '20', false)'</textarea>';

but this gave me syntax errors (obviously).
so i changed to
$editor =& JFactory::getEditor(); 
$output = $editor->display("K2ExtraField_".$extraField->id."", $active[0], '550', '400', '60', '20', false);

this gives me enlarged editing areas but still no JCE editor.
i dont mind having it hardcoded, but i realy need a better editor than what comes by default on the Extra Field's textarea NicEditor.

any suggestions?

Quia Ego Sic Dico

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
11 years 3 months ago #115345 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: JCE editor in Extra Fields
Hello yair abelson,

I don't think is necessary, you just have to enable the system editor option. This is located in the extrafield's settings. Then the textarea will display your default system editor.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum