2012-08-04 13 views
5

Varolan kodum, buna benzeyen bir menü oluşturur.Magento'da varolan bir menüye nasıl alt menü ekleyebilirim?

custom magento menu

Ama Katalog menüsünün bir alt menüsü olan bir menü istiyorum.

İşte adminhtml.xml

<?xml version="1.0" ?> 
<config> 
    <menu> 
     <mycustom_menu translate="title" module="brands"> 
      <title>My Custom Menu Item</title> 
      <sort_order>300</sort_order> 
      <children> 
       <!-- child items go here --> 
       <subitem translate="title" module="brands"> 
        <title>Manage Brands</title> 
        <sort_order>10</sort_order> 
        <action>adminhtml/mycustom_controller/</action> 
       </subitem> 
      </children> 
     </mycustom_menu> 
    </menu> 
    <acl> 
     <resources> 
      <admin> 
       <children> 
        <mycustom_menu translate="title" module="brands"> 
         <title>My Custom Menu Item</title> 
         <sort_order>300</sort_order> 
         <children> 
          <subitem translate="title" module="brands"> 
           <title>Subitem</title> 
           <sort_order>10</sort_order> 
          </subitem> 
         </children> 
        </mycustom_menu> 
       </children> 
      </admin> 
     </resources> 
    </acl> 
</config> 

cevap

24

yerine katalog modülünün adminhtml.xml kullanılmıştır yeniden kullanmak düğümadı için gereken <mycustom_menu> kullanarak varolan kodudur. Bu ad catalog. örnek müşteri sekmede alt menüye eklemek için için

<?xml version="1.0"?> 
<config> 
     <menu> 
      <catalog> 
        <children> 
          <your_subitem> 
            <title>Subitem 1</title> 
            <sort_order>10</sort_order> 
            <action>adminhtml/your_action</action> 
          </your_subitem> 
        </children> 
      </catalog> 
    </menu> 
    <acl> 
      <resources> 
        <admin> 
          <children> 
            <catalog> 
              <title>Subitem 1</title> 
              <sort_order>10</sort_order> 
            </catalog> 
          </children> 
        </admin> 
      </resources> 
    </acl> 
</config> 
+1

i config.xml'de varsayılan katalog adını bu kodu eklemek çalıştığınızda

Yani XML gibi görünmelidir acl rollerinde subitem ile değiştirildi. nasıl düzeltebilirim haklısın – Naveenbos

+0

@Naveenbos, ACL için kodu doğru değil, 'olmalıdır \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t Alt Öğe 1 \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t ' – electroid

0

:

<menu> 
    <customer> 
     <children> 
      <vendor module="yourmodule"> 
      <title>Your Title</title> 
      <sort_order>0</sort_order> 
      <action>admin_yourmodule/adminhtml_yourmoduleaction</action> 
      </vendor> 
     </children> 
    </customer> 
</menu> 
İlgili konular