0

I'm using Magento 1.9.0.1 and i've created a new extension in which i've added a new tab in the admin panel take a look at the picture.

enter image description here

Here is what i have in my files.

In: /app/code/community/VivasIndustries/SmsNotification/etc/config.xml:

<?xml version="1.0"?>
<config>
  <modules>
    <VivasIndustries_SmsNotification>
      <version>0.1.0</version>
    </VivasIndustries_SmsNotification>
  </modules>
  <global>
    <models>
        <smsnotification>
            <class>VivasIndustries_SmsNotification_Model</class>
        </smsnotification>
    </models>  
    <events>
        <sales_order_save_after>
            <observers>
                <vivasindustries_smsnotification>
                    <class>smsnotification/observer</class>
                    <method>orderSaved</method>
                </vivasindustries_smsnotification>
            </observers>
        </sales_order_save_after>
    </events>
    <helpers>
        <smsnotification>
            <class>VivasIndustries_SmsNotification_Helper</class>
        </smsnotification>
        <adminhtml>
            <rewrite>
                <data>VivasIndustries_SmsNotification_Helper_Adminhtml_Data</data>
            </rewrite>
        </adminhtml>
    </helpers>
  </global>
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <VivasIndustries_SmsNotification before="Mage_Adminhtml">VivasIndustries_SmsNotification_Adminhtml</VivasIndustries_SmsNotification>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
</config>  

Here is what i have in: /app/code/community/VivasIndustries/SmsNotification/etc/adminhtml.xml:

<?xml version="1.0"?>
<config>
    <menu>
        <vivassms translate="title" module="smsnotification">
            <title>SMS Center</title>
            <sort_order>110</sort_order>
            <children>
                <sendsms translate="title" module="smsnotification">
                    <title>Send SMS</title>
                    <action>adminhtml/magesms_sendsms</action>
                    <sort_order>1</sort_order>
                </sendsms>
                <settings>
                    <title>Settings</title>
                    <action>adminhtml/system_config/edit/section/vivas/</action>
                    <sort_order>10</sort_order>
                </settings>
                <about translate="title" module="smsnotification">
                    <title>About</title>
                    <action>adminhtml/smsnotification_about</action>
                    <sort_order>11</sort_order>
                </about>
            </children>
        </vivassms>
    </menu>
    <acl>
        <resources>
            <admin>
                <children>
                    <vivassms>
                        <title>SMS</title>
                        <children>
                            <sendsms translate="title" module="smsnotification">
                                <title>Send SMS</title>
                            </sendsms>
                            <settings>
                                <title>Settings</title>
                                <children>
                                    <smsprofile translate="title" module="smsnotification">
                                        <title>Edit user account</title>
                                    </smsprofile>
                                </children>
                            </settings>
                            <about translate="title" module="smsnotification">
                                <title>About</title>
                            </about>
                        </children>
                    </vivassms>
                    <system>
                        <children>
                            <config>
                                <children>
                                    <vivassms translate="title" module="smsnotification">
                                        <title>Vivas SMS</title>
                                    </vivassms>
                                </children>
                            </config>
                        </children>
                    </system>
                </children>
            </admin>
        </resources>
    </acl>
</config>

I've added these three children tabs to the created new tab SMS Center but when i click on the About tab i got error 404 ON MY FRONTEND. This is awkward. Why i got redirected to the frontend ?

Can you please help me out to create a simple new custom page in the admin panel where i want to add a simple text?

Thanks in advance!

Venelin
  • 2,905
  • 7
  • 53
  • 117

1 Answers1

2

Seems like Magento recognizes your module is telling it "Check me for admin" controllers, but that Magento doesn't find any. The best way to figure out what Magento thinks your controller file should be named (as well as which folder it should be located in) is to add some temporary debugging to _validateControllerClassName

protected function _validateControllerClassName($realModule, $controller)
{
    $controllerFileName = $this->getControllerFileName($realModule, $controller);
    if (!$this->validateControllerFileName($controllerFileName)) {
        var_dump($controllerFileName);  //add this line    
        return false;
    }

This will dump out every file Magento checks for a controller. Look for the line with your module name in it, and compare paths between where your file is located and where Magento thinks it should be located.

Alana Storm
  • 164,128
  • 91
  • 395
  • 599
  • In which file should i place this function ? Thanks! – Venelin Feb 06 '15 at 21:50
  • 1
    You shouldn't palceit anywhere, you should edit the _validateControllerClassName function that exists in your Magento core system. A quick text search should help you find it. – Alana Storm Feb 06 '15 at 21:57
  • I've found it and when i place it and opened the `About` page again i got the following: http://pastebin.com/zzyv41Ed Please take a look and give me any advice! Thanks in advance! – Venelin Feb 06 '15 at 22:23
  • 1
    @The Lex My advice would be when someone lays out a path to a solution you try following that advice before leaning on that person again. – Alana Storm Feb 06 '15 at 22:27
  • Thanks but i don't get it at all everything that is printed after i changed the function as you said. Please if you see where the problem is help me out ;) Thank you! – Venelin Feb 06 '15 at 22:41