문제

I need to know the easiest way to add menu within the magento nav menu. Is there ane FREE extension that can provide the functionality to add custom links to nav menu without making any Rewrites from Magento?

I already made a research but without success. Can anyone help me please?

도움이 되었습니까?

해결책

Have you tried MegaMenu master? Is a free extension and can be found on GitHub.

다른 팁

If you are working with Magento ce 1.7+ you can use the event page_block_html_topmenu_gethtml_before.
In version 1.7+ the top menu is treated as a container where you can place any link you want.
Here is a small example. Your observer can look like this:

class [Namespace]_[Module]_Model_Observer {
    public function addItemsToTopmenuItems($observer) {
        $menu = $observer->getMenu();
        $tree = $menu->getTree();
        $action = Mage::app()->getFrontController()->getAction()->getFullActionName();

        $nodeId = 'some-node-id';
        $data = array(
            'name' => Mage::helper('[module]')->__('Title goes here'),
            'id' => $nodeId,
            'url' => Mage::getUrl('module/controller/action'),
            'is_active' => ($action == 'module_controller_action')
        );
        $node = new Varien_Data_Tree_Node($data, 'id', $tree, $menu);
        $menu->addChild($node);
        return $this;
    }
}

and the event declaration in config.xml

<frontend>
    <events>
        <page_block_html_topmenu_gethtml_before>
            <observers>
                <[module]>
                    <class>[module]/observer</class>
                    <method>addItemsToTopmenuItems</method>
                </[module]>
            </observers>
        </page_block_html_topmenu_gethtml_before>
    </events>
</frontend>

This will add an item after the categories.
To add items at the beginning or middle of the menu check this

Note: Of course this is an example. You can make your module to support adding links through the config panel or anything else that you can thing of.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top