0
votes

I looked through many sites and articles about adding items to admin menu in magento, some examples I copied one to one and I haven't gotten any result. Please tell me what I did wrong?

I have the module SmartLetter, it's showing in the module list.

Magento ver. 1.9.2.2

The path to the module folder is - app ▸ code ▸ local ▸ Chu ▸ SmartLetter

config.xml:

<?xml version="1.0"?>
<config>
    <modules>
        <Chu_SmartLetter>
            <version>0.0.1</version>
        </Chu_SmartLetter>
    </modules>
    <global>

    </global>
</config>   

adminhtml.xml:

<?xml version="1.0"?>
<config>
    <menu>
        <smartletter translate="title" module="smartletter">
            <title>Smart Letter</title>
            <sort_order>40</sort_order>
        </smartletter>
    </menu>
        <acl>
        <resources>
            <admin>
                <children>
                    <system>
                        <children>
                            <config>
                                <children>
                                    <smartletter translate="title" module="smartletter">
                                        <title>SmartLetter Section</title>
                                    </smartletter>
                                </children>
                            </config>
                        </children>
                    </system>
                </children>
            </admin>
        </resources>
    </acl>
</config>
1

1 Answers

1
votes

You are missing a helper for your module, does useful stuff like translations which the menu required.

Create a helper under app/code/local/Chu/SmartLetter/Helper/Data.php:

<?php

class Chu_SmartLetter_Helper_Data extends Mage_Core_Helper_Abstract {

}

Add it to your global config.xml definition:

<global>
    <helpers>
        <chu_smartletter>
            <class>Chu_SmartLetter_Helper</class>
        </chu_smartletter>
    </helpers>
</global>

Update your adminhtml.xml to use the module="chu_smartletter"

On a side note I would recommend not to clutter the top level menu, is your module that important? I would nest it under one of the existing menu items.