0

如何使用我的自定义模块在 cms 块的编辑页面上为 cms 选项卡菜单添加额外的选项卡。任何人都可以帮忙。

谢谢

4

1 回答 1

3

您可以使用布局并将自己的块添加到选项卡:

<?xml version="1.0"?>
<layout version="0.0.1">
    <adminhtml_cms_page_edit>
        <reference name="cms_page_edit_tabs">
            <block type="module/cms_page_edit_tab_tags" name="cms_page_edit_tab_tags" after="cms_page_edit_tab_meta"/>                
            <action method="addTab"><name>tags_section</name><block>cms_page_edit_tab_tags</block></action>                                
        </reference>
    </adminhtml_cms_page_edit>
</layout>

并阻止实施

class My_Module_Block_Cms_Page_Edit_Tab_Tags 
extends Mage_Adminhtml_Block_Widget_Form
implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
    protected function _prepareForm()
    {
        $form = new Varien_Data_Form();
        $this->setForm($form);
        // your tab code here
        return parent::_prepareForm();
    }

    public function getTabLabel()
    {
        return Mage::helper('cms')->__('Cms Pages Products');
    }

    public function getTabTitle()
    {
        return Mage::helper('cms')->__('Cms Pages Products');
    }

    public function canShowTab()
    {
        return true;
    }

    public function isHidden()
    {
        return false;
    }
}

查看 app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/* 和 app/design/adminhtml/default/default/layout/cms.xml 的实现

于 2012-12-21T11:57:57.100 回答