I have created the custom module in admin panel and I have tried to implement wysiwyg editor in that, but i did not get the proper editor. I got with full page including tabs and all..I dont know where i have done mistakes.
This is the lines included in my block/admininhtml/demo/edit/tab/blog.php
file:
$fieldset->addField('content', 'editor', array(
'name' => 'content',
'label' => Mage::helper('demo')->__('Content'),
'title' => Mage::helper('demo')->__('Content'),
'style' => 'width:98%; height:400px;',
'config' => Mage::getSingleton('cms/wysiwyg_config')->getConfig(),
'wysiwyg' => true,
'required' => false,
));
Then I have added a function in Block/Admininhtml/Demo/Edit/Form.php
protected function _prepareLayout() {
parent::_prepareLayout();
if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
$this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
}
}
Can anyone help me to get this editor. Thanks in advance.