2
votes

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.

1

1 Answers

0
votes

Can you check with

'wysiwyg_enabled' => true,

I find that 'wysiwyg' => true, doesn't work for me but it is present in many articles on the web. Working example:

array(
    'type'          => 'text',
    'label'         => 'Category Blocks',
    'input'         => 'textarea',
    'group'         => 'General Information',
    'global'        => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
    'visible'       => true,
    'wysiwyg_enabled' => true,
    'visible_on_front' => true,
    'is_html_allowed_on_front' => true,
    'required'      => false
));