繁体   English   中英

wysiwyg编辑器在magento的admin自定义模块中不起作用

[英]wysiwyg editor is not working in admin custom module in magento

我已经在管理面板中创建了自定义模块,并尝试在其中实现所见即所得的编辑器,但是我没有获得适当的编辑器。 我有整页的页面,包括标签和所有..我不知道我在哪里犯了错误。

这是我的block/admininhtml/demo/edit/tab/blog.php文件中包含的行:

    $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,
));

然后我在Block / Admininhtml / Demo / Edit / Form.php中添加了一个功能

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

谁能帮我得到这个编辑器。 提前致谢。

你可以检查一下吗

'wysiwyg_enabled' => true,

我发现'wysiwyg' => true,对我不起作用,但是它在网络上的许多文章中都有介绍。 工作示例:

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
));

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM