将菜单项添加到管理菜单

时间:2013-01-22 22:06:09

标签: magento-1.7 magento

我正在尝试将几个菜单项添加到Magento Admin区域。以下代码显示“本地访问IP”子菜单项,但不显示“远程访问日志”子菜单项。

<?xml version="1.0"?>
<config>
 <menu>
    <VMR_Whitelist_menu translate="title" module="VMR_Whitelist">
        <title>VMR Modules</title>
        <sort_order>300</sort_order>
        <children>
            <!-- child items go here -->
            <subitem translate="title" module="VMR_Whitelist">
                <title>Remote Access Logs</title>
                <sort_order>9</sort_order>
                <action>adminhtml/whitelist/logs</action>
            </subitem>                
            <subitem translate="title" module="VMR_Whitelist">
                <title>Local Access IPs</title>
                <sort_order>10</sort_order>
                <action>adminhtml/whitelist/local</action>
            </subitem>
        </children>
    </VMR_Whitelist_menu>
 </menu>
  <acl>
    <resources>
        <admin>
            <children>
                <VMR_Whitelist_menu translate="title" module="VMR_Whitelist">
                    <title>VMR Modules</title>
                    <sort_order>300</sort_order>
                    <children>
                        <!-- child items go here -->
                        <subitem translate="title" module="VMR_Whitelist">
                            <title>Remote Access Logs</title>
                            <sort_order>9</sort_order>
                        </subitem>
                        <subitem translate="title" module="VMR_Whitelist">
                            <title>Local Access IP Write Access</title>
                            <sort_order>10</sort_order>
                        </subitem>
                    </children>
                </VMR_Whitelist_menu>
            </children>
        </admin>
    </resources>
</acl>
</config>

任何关于为什么会出现而不出现其他人的想法都非常感谢!

1 个答案:

答案 0 :(得分:0)

<subitem translate="title" module="VMR_Whitelist">

项目名称不能在一个分支中重复。给它另一个名字。像:

        <firstitem translate="title" module="VMR_Whitelist">
            <title>Remote Access Logs</title>
            <sort_order>9</sort_order>
            <action>adminhtml/whitelist/logs</action>
        </firstitem>                
        <seconditem translate="title" module="VMR_Whitelist">
            <title>Local Access IPs</title>
            <sort_order>10</sort_order>
            <action>adminhtml/whitelist/local</action>
        </seconditem>