0

我在 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>

感谢您的帮助 :)

4

1 回答 1

0

我找到了:

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

在 Adminhtml 控制器中使用它!

于 2012-10-24T11:15:45.430 回答