0

I am using Magento 1.9. In the admin panel, I have created a sub menu named Whatsapp Notification inside the System menu.

The sub menu in turns have two children menu, named Template and Configuration.

I created a new module WhatsappNotification, and did all the initial setup for the module.

In the etc/adminhtml.xml my configuration is as follows :

<adminhtml>
<menu>
  <system>
      <children>
          <whatsappnotification translate="title" module="whatsappnotification">
                <title>Whatsapp Notification</title>
                <children>
                    <template>
                        <title>Template</title>
                        <action>whatsappnotification/adminhtml_whatsapptemplate_index</action>
                        <sort_order>10</sort_order>
                    </template>
                    <config>
                        <title>Configuration</title>
                        <action>whatsappnotification/adminhtml_whatsappconfiguration_index</action>
                        <sort_order>20</sort_order>
                    </config>
                </children>
            </whatsappnotification>
        </children>
    </system>
</menu> 
</adminhtml>

Here I am calling the index method defined in the controller of the respective children menu.

But when I am clicking on either children menu Template or Configuration, it doesn't redirects to the controller (In the controller I am loading a form, but the call doesn't come to the controller itself).

I am also showing my etc/config.xml :

<?xml version="1.0"?>
 <config>

<modules>
    <Dbaux_WhatsappNotification>
        <version>0.0.1</version>
    </Dbaux_WhatsappNotification>
</modules>

<global>
    <helpers>
        <whatsappnotification>
            <class>Dbaux_WhatsappNotification_Helper</class>
        </whatsappnotification>
    </helpers> 
    <blocks>
        <whatsappnotification>
            <class>Dbuax_WhatsappNotification_Block</class>
        </whatsappnotification>
    </blocks>
</global>

 </config>

And my module structure is as shown :

enter image description here

Is there anything else that I need to do apart from this to get the call to the controller function?

  • Does the provided answer resolves your problem? – mydons Nov 6 at 10:46
0

You need to add the Admin Router information in your config.xml

<admin>
  <routers>
    <adminhtml>
        <args>
            <modules>
              <Dbaux_WhatsappNotification before="Mage_Adminhtml">Dbaux_WhatsappNotification_Adminhtml</Dbaux_WhatsappNotification>
            </modules>
        </args>
    </adminhtml>
  </routers>
</admin>

Also modify the adminhtml.xml as shown below

<?xml version="1.0"?>
<adminhtml>
<menu>
  <system>
     <children>
        <whatsappnotification translate="title" module="whatsappnotification">
            <title>Whatsapp Notification</title>
            <children>
                <template>
                    <title>Template</title>
                    <action>adminhtml/whatsapptemplate</action>
                    <sort_order>10</sort_order>
                </template>
                <config>
                    <title>Configuration</title>
                    <action>adminhtml/whatsappconfiguration</action>
                    <sort_order>20</sort_order>
                </config>
            </children>
        </whatsappnotification>
     </children>
   </system>
  </menu> 
</adminhtml>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.