簡體   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