Friday, December 10, 2010

Adding TInyMCE Editor in Magento Custom Module

I've created an custom module from module creator but i couldnot displayed tinymce wysiwyg editor in admin page ?

though modulecreator guys has added default field of "content" for editor:

$fieldset->addField('contentdesc', 'editor', array(
'name' => 'contentdesc',
'label' => Mage::helper('getthelooks')->__('Description'),
'title' => Mage::helper('getthelooks')->__('Description'),
'style' => 'width:500px; height:300px;',
'config' => Mage::getSingleton('cms/wysiwyg_config')->getConfig(),
'wysiwyg' => true,
'required' => true,
));

but even i change wysiwyg to true it didnt worked. module creator has forgot that to enable wysiwyg we also needed js for that

so here is complete simple layout xml file :





1










js_cssprototype/windows/themes/default.css
js_cssprototype/windows/themes/magento.css










change getthelooks to your custom module name and enjoy!

3 comments:

  1. thanks for sharing.... but for me whole form is coming in the editor instead of the textarea content

    ReplyDelete
  2. hello

    we have inlcude these Css but still not view editor can you please help me

    Thnaks

    ReplyDelete
  3. whole form is coming in the editor instead of the textarea content..

    I am using magento 1.6.

    Do you have any idea why?

    ReplyDelete