【问题标题】:Create Custom Magento Admin Page Layout创建自定义 Magento 管理页面布局
【发布时间】:2014-02-11 12:04:08
【问题描述】:

我正在尝试创建自定义 Magento 管理页面,但我似乎无法让我的布局或模板出现在页面中。该页面在菜单中显示得很好,但是当您单击它时,您只会得到一个空白的管理页面。我遵循了一些不同的教程,并且至少完成了整个过程两次,但无法弄清楚为什么我的模板没有出现。 You can download all the source here.

【问题讨论】:

    标签: xml magento templates layout


    【解决方案1】:

    在 Saxx_Forzani_Block_Adminhtml_Forzani 你可以做

    public function __construct()
    {
        parent::__construct();
        $this->setTemplate('forzani/admincontent.phtml');
    }
    

    然后你可以在控制器中做

    public function indexAction()
    {
         $this->_initAction()
            ->_addContent($this->getLayout()->createBlock('saxx_forzani/adminhtml_forzani'))
            ->renderLayout();
    }
    

    【讨论】:

    • 只要 Saxx_Forzani_Block_Adminhtml_Forzani 扩展 Mage_Core_Block_Template,这应该可以工作
    猜你喜欢
    • 1970-01-01
    • 2018-02-15
    • 2011-09-21
    • 1970-01-01
    • 1970-01-01
    • 2018-08-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多