在自定义管理页面上使用Magento 1.4的WYSIWYG编辑器

Mar*_*ive 3 tinymce magento

任何人都知道如何让新的1.4 WYSIWYG编辑器(TinyMCE)使用自定义管理页面?

我有一些我在admin-> system-> config部分有输入字段的模块,我想让新的编辑器显示在那里的textareas上,但我找不到它们的定义.

小智 6

要在特定页面上加载TINY MCE,请在模块的Adminhtml Edit块上使用以下功能:

protected function _prepareLayout() {
 parent::_prepareLayout();
 if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
  $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
 }
} 
Run Code Online (Sandbox Code Playgroud)

要为某个可编辑的文本字段启用编辑器,只需使用'wysiwyg'=> true,而不是'wysiwyg'=> false.即:

$fieldset->addField('description', 'editor', array(
    'name'      => 'description',
    'label'     => Mage::helper('sevents')->__('Description'),
    'title'     => Mage::helper('sevents')->__('Description'),
    'style'     => 'height:12em;width:500px;',
    'config'    => Mage::getSingleton('cms/wysiwyg_config')->getConfig(),
    'wysiwyg'   => true,
    'required'  => true,
)); 
Run Code Online (Sandbox Code Playgroud)