I need to add extra WYSIWYG editor in CMS > Pages > Content section. See below,
It has added through observer, In config.xml
<adminhtml_cms_page_edit_tab_content_prepare_form>
<observers>
<abcrewrite_page_edit_tab_content>
<type>singleton</type>
<class>Abc_Pqr_Model_Observer</class>
<method>setCmsPageSummary</method>
</abcrewrite_page_edit_tab_content>
</observers>
</adminhtml_cms_page_edit_tab_content_prepare_form>
In my observer.php
public function setCmsPageSummary($observer)
{ $cmsPage = Mage::registry('cms_page'); $form = $observer->getForm(); $fieldset = $form->getElement('content_fieldset'); $fieldset->addField('cms_page_summary', 'editor', array(
'name' => 'cms_page_summary',
'label' => Mage::helper('cms')->__('Cms Page Summary'),
'title' => Mage::helper('cms')->__('Cms Page Summary'),
'config' => Mage::getSingleton('cms/wysiwyg_config')->getConfig( array('add_variables' => false,
'add_widgets' => false,
'files_browser_window_url' => Mage::getSingleton(
'adminhtml/url'
)->getUrl('adminhtml/cms_wysiwyg_images/index'))
),
'wysiwyg' => true,
'value' => $cmsPage->getCmsPageSummary(),
'disabled' => false,
));
}
The problem was when I try to insert image to content section, the image url is past on 'cms page summary' section which I newly added one. but It should past inside content editor not in newly added editor.
Same thing happen magento default, I just checked in magento-ce 1.9 duplicate the core field in app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Content.php
$contentField = $fieldset->addField('content1', 'editor', array(
'name' => 'content1',
'style' => 'height:36em;',
'required' => true,
'disabled' => $isElementDisabled,
'config' => $wysiwygConfig
));
How do I avoid this issue???