0

所以我正在覆盖一个添加一些选项卡的块。我要做的就是删除几个标签。然而,即使我的代码中的 die() 杀死了所有东西(所以它被调用了),我在标签曾经所在的地方得到了一个空白点。这是代码:

配置.xml:

<global>
        <blocks>
            <affiliateplusext>
                <class>Blizzardlabs_Affiliateplusext_Block</class>
            </affiliateplusext>                
            <affiliateplusstatistic>
                <rewrite>
                    <frontend_diagrams>Blizzardlabs_Affiliateplusext_Block_Frontend_Diagrams</frontend_diagrams>
                </rewrite>
            </affiliateplusstatistic>
        </blocks>
</global>

他们的布局文件:

class Magestore_Affiliateplusstatistic_Block_Frontend_Diagrams extends Mage_Adminhtml_Block_Widget_Tabs
{
    public function __construct(){
        parent::__construct();
        $this->setId('diagram_tab');
        $this->setDestElementId('diagram_tab_content');
        $this->setTemplate('affiliateplusstatistic/widget/tabshoriz.phtml');
    }

    protected function _prepareLayout(){
        $this->addTab('sales',array(
            'label'     => $this->__('Sales Amount'),
            'content'   => $this->getLayout()->createBlock('affiliateplusstatistic/frontend_diagrams_sales')->toHtml(),
            //'active'  => true,
        ));

        $this->addTab('transactions',array(
            'label'     => $this->__('Transactions'),
            'content'   => $this->getLayout()->createBlock('affiliateplusstatistic/frontend_diagrams_transactions')->toHtml(),
        ));

        $this->addTab('commissions',array(
            'label'     => $this->__('Commissions'),
            'content'   => $this->getLayout()->createBlock('affiliateplusstatistic/frontend_diagrams_commissions')->toHtml(),
        ));

        $this->addTab('clicks',array(
            'label'     => $this->__('Clicks'),
            'content'   => $this->getLayout()->createBlock('affiliateplusstatistic/frontend_diagrams_clicks')->toHtml(),
        ));

        $this->addTab('impressions',array(
            'label'     => $this->__('Impressions'),
            'content'   => $this->getLayout()->createBlock('affiliateplusstatistic/frontend_diagrams_impressions')->toHtml(),
        ));

        $this->setChild('totals',$this->getLayout()->createBlock('affiliateplusstatistic/frontend_diagrams_totals'));
        $this->setChild('filters',$this->getLayout()->createBlock('affiliateplusstatistic/frontend_filters'));

        return parent::_prepareLayout();
    }
}

我的布局文件:

<?php
class Blizzardlabs_Affiliateplusext_Block_Frontend_Diagrams extends Magestore_Affiliateplusstatistic_Block_Frontend_Diagrams
{
    protected function _prepareLayout(){
        $this->addTab('sales',array(
            'label'     => $this->__('Sales Amount'),
            'content'   => $this->getLayout()->createBlock('affiliateplusstatistic/frontend_diagrams_sales')->toHtml(),
            'active'    => true,
        ));
//      
//      $this->addTab('transactions',array(
//          'label'     => $this->__('Transactions'),
//          'content'   => $this->getLayout()->createBlock('affiliateplusstatistic/frontend_diagrams_transactions')->toHtml(),
//      ));
//      
//      $this->addTab('commissions',array(
//          'label'     => $this->__('Commissions'),
//          'content'   => $this->getLayout()->createBlock('affiliateplusstatistic/frontend_diagrams_commissions')->toHtml(),
//      ));
//      
//
//        
//        $this->setChild('totals',$this->getLayout()->createBlock('affiliateplusstatistic/frontend_diagrams_totals'));
//        $this->setChild('filters',$this->getLayout()->createBlock('affiliateplusstatistic/frontend_filters'));

        return parent::_prepareLayout();
    }
}

没有错误或日志。请帮忙!

4

1 回答 1

1

我不确定布局 xml 的操作顺序。但我知道我已经从设计文件夹中的 local.xml 中删除了其他模块上的选项卡,如下所示:

<module_controller_action> <!-- **(Direct accordingly) -->
    <reference name="the_specific_tabs_block_name">
        <action method="removeTab"><name>transactions</name></action>
    </reference>
</module_controller_action>

比制作​​课程和扩展原始课程要好得多。(如果有效)

祝你好运。

于 2013-06-08T10:21:09.933 回答