从 Magento 的管理面板导航中删除项目

2021-12-19 00:00:00 xml overriding navigation php magento

使用 Magento 电子商务系统,是否可以从管理面板导航菜单中删除项目?更一般地说,有没有办法使用配置覆盖系统从配置中删除现有元素?

Using the Magento Ecommerce system, is is possible to remove an item from the Admin Panel Navigation menu? More generally, is there a way to use the config override system to remove existing elements from a configuration?

我知道我可以使用如下所示的替代添加到导航中

I know I can add to the navigation with an override that looks something like this

<?xml version="1.0"?>
<config>
    <modules>
        <Company_Module>
            <version>
                0.1.0
            </version>
        </Company_Module>
    </modules>

    <adminhtml>
        <menu>
             <cms translate="title" module="cms">
                <title>The CMS</title>
                <sort_order>70</sort_order>
                <children>
                    <foo translate="title" module="cms">
                        <title>Foo Item</title>
                        <action>adminhtml/foo</action>
                    </foo>
                </children>
             </cms>
        </menu>    
    </adminhtml>
</config>

但是我如何/如何完全取消 CMS 导航项?

but how would/could I completely suppress the CMS navigation item?

推荐答案

更简洁的方法:

添加 adminhtml.xml(例如,添加到保留所有其他自定义内容的现有模块,或创建新模块)

Add a adminhtml.xml (e.g. to an existing modules that keeps all other customization stuff, or create a new module)

<?xml version="1.0" ?>
<config>
    <menu>
        <xmlconnect>
            <disabled>1</disabled>
        </xmlconnect>
    </menu>
</config>

相关文章