I need to insert two wysiwyg fields with tinymce in my backend module in the same form.
It's working when I insert only one with this code in the edit tab form:
$fieldset->addField('mother', 'editor', array(
'name' => 'mother',
'label' => Mage::helper('cms')->__('Mother content'),
'title' => Mage::helper('cms')->__('Mother content'),
'style' => 'height:12em;width:30em',
'required' => true,
'wisiwyg' => false,
'config' => Mage::getSingleton('cms/wysiwyg_config')->getConfig()
));
and this one in the editAction in the controllers
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
$this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
}
But when I try to insert a second one, chrome doesn't load tinymce and crashes (unable to close the tab in chrome, I need to use windows task management to cancel the chrome process). Maybe a JS conflict? I can't even access the console in chrome...
[EDIT after comment] And below the maybe problematic code for the second wysiwyg field
$fieldset->addField('content', 'editor', array(
'name' => 'content',
'label' => Mage::helper('cms')->__('Main content'),
'title' => Mage::helper('cms')->__('Main content'),
//'style' => 'height:36em;width:30em',
'required' => true,
'wisiwyg' => true,
'config' => Mage::getSingleton('cms/wysiwyg_config')->getConfig(),
));