Magento自定义模块:如何创建管理菜单

时间:2013-07-05 05:42:39

标签: magento

Finder
Setting

从管理菜单设置进入我们自定义模块的系统/配置的URL应该是什么。

<menu>
 <finder module="finder">
  <title>finder</title>
    <sort_order>71</sort_order>               
      <children>
    <items module="finder">
    <title>Manage Finder</title>
    <sort_order>0</sort_order>
    <action>finder/adminhtml_finder</action>
   </items>
       <items module="finder">
    <title>Setting</title>
    <sort_order>0</sort_order>
    <action> ????  </action>
</items>
  </children>
    </finder>
    </menu>

5 个答案:

答案 0 :(得分:2)

杰克你可以采取以下行动:

<action>adminhtml/system_config/edit/section/your menu item</action>

http://inchoo.net/ecommerce/magento/create-configuration-for-your-magento-extension/这是一个很好的例子。

答案 1 :(得分:1)

您可以按照以下方式添加系统配置目录。你必须创建system.xml

<?xml version="1.0"?>
<config>
    <tabs>
        <helloconfig translate="label" module="todaydeal">
            <label>Today Deal</label>
            <sort_order>99999</sort_order>
        </helloconfig>
    </tabs> 
   <sections>
        <catalog>
            <groups>
                <todaydeal translate="label" module="todaydeal">
                    <label>Daily Deal</label>
                    <frontend_type>text</frontend_type>
                    <sort_order>1000</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>

                    <fields>
                        <active translate="label">
                            <label>Enabled</label>
                            <frontend_type>select</frontend_type>
                            <source_model>adminhtml/system_config_source_yesno</source_model>
                            <sort_order>1</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>0</show_in_store>
                        </active>                        
                    </fields>
                </todaydeal>
            </groups>
        </catalog>
    </sections>
</config>

您也可以参考详情Document LINK,我相信我会对您有所帮助。

让我知道我是否可以帮助你进一步

答案 2 :(得分:1)

您可以使用以下代码创建管理员侧面菜单,还可以执行系统/配置操作。在app / code / local / [Name_Space] / [Module_Name] /etc/config.xml

中添加以下代码
      <adminhtml>
         <menu>
            <news module="news">
                <title>News</title>
                <sort_order>71</sort_order>               
                <children>
                    <items module="news">
                        <title>Manage Items</title>
                        <sort_order>0</sort_order>
                        <action>news/adminhtml_news</action>
                    </items>
                    <items1 module="news">
                        <title>Import News Data</title>
                        <sort_order>1</sort_order>
                        <action>adminhtml/system_config/edit/section/news</action>
                    </items1>
                </children>
            </news>
        </menu>
  </adminhtml>  

请注意,此处的新闻与system.xml文件中的部分名称相同。

答案 3 :(得分:1)

您好,请添加以下代码,而不是<itmes>

 <config module="finder">
                        <title>Configurations</title>
                        <sort_order>10</sort_order>
                        <action>adminhtml/system_config/edit/section/finder</action>
                    </config>

              Write down ACL code after the </menu> ending tag.  Your code will be like this 

              <acl>
    <resources>
        <all>
            <title>Allow Everything</title>
        </all>
        <admin>
            <children>
                <My_module>
                    <title>My finder Module</title>
                    <sort_order>10</sort_order>
                </My_module>
                <system>
                    <children>
                    <config>
                        <children>
                        <finder>
                            <title>finder Module Section</title>
                        </finder>
                        </children>
                    </config>
                    </children>
                </system>
            </children>
        </admin>
    </resources>
</acl>

答案 4 :(得分:0)

您可以参考下面的链接在Magento2中创建管理菜单: https://github.com/jainmegha5395/admin-menu

说明:

  

您需要在模块的\ etc \ adminhtml \内部创建menu.xml文件。

<menu>标签内添加以下代码。

  <add id="Custom_Module::custom" title="CUSTOM" translate="title" module="Custom_Module" sortOrder="90" dependsOnModule="Custom_Module" resource="Custom_Module::custom"/>

  <add id="Custom_Module::news" title="News" translate="title" module="Custom_Module" parent="Custom_Module::custom" sortOrder="50" dependsOnModule="Custom_Module" resource="Custom_Module::news"/>

此代码将创建一个名为NEWS的菜单,其标题为CUSTOM

相关问题