【问题标题】:magento : menu class don't turn to activemagento:菜单类不激活
【发布时间】:2012-06-20 09:19:21
【问题描述】:

我在 magento admin 中创建了自己的模块,并添加了一个带有 config.xml 文件的菜单:

 <adminhtml>
        <!-- The <layout> updates allow us to define our block layouts in a separate file so are aren't messin' with the Magento layout files.  -->
        <layout>
            <updates>
                <ineractivebanner>
                    <file>adminbanner.xml</file>
                </ineractivebanner>
            </updates>
        </layout>
        <!-- The <acl> section is for access control. Here we define the pieces where access can be controlled within a role. -->
        <acl>
            <resources>
                <admin>
                    <children>
                        <ineractivebanner>
                            <title>Banner Menu Item</title>
                            <children>
                                <interactivebannermenu>
                                    <title>Banner Menu Item</title>
                                </interactivebannermenu>
                            </children>
                        </ineractivebanner>
                    </children>
                </admin>
            </resources>
        </acl>
      <menu>
        <interactivebanner>
            <title>Banners</title>
            <sort_order>71</sort_order>
            <children>
                <interactivebannermenu>
                    <title>Manage Banners</title>
                    <sort_order>1</sort_order>
                    <action>interbanner/adminhtml_banner/index</action>
                </interactivebannermenu>
            </children>
       </interactivebanner>
    </menu>
    </adminhtml>    

一切正常,但菜单类在我的模块中没有变为活动状态!

<li class="parent level0" onmouseout="Element.removeClassName(this,'over')" onmouseover="Element.addClassName(this,'over')">
<a class="" onclick="return false" href="#">
<span>Banners</span>
</a>
<ul>
</li>

感谢您的帮助:)

【问题讨论】:

    标签: css magento menu admin


    【解决方案1】:

    我找到了:

    protected function _initAction() {
        $this -> loadLayout() -> _setActiveMenu(' ') -> _addBreadcrumb(' ', ' ');
        return $this;
    }
    

    在 Adminhtml 控制器中使用它!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-06-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-26
      • 1970-01-01
      • 2021-09-02
      • 2021-03-03
      相关资源
      最近更新 更多