Change in topMenu from 1.6 to 1.7

In Magento 1.6, page.xml added topmenu block to the default scope.


catalog.xml then added the catalog/navigation block catalog/navigation from catalog/navigation/top.phtml to the topmenu block.


This arrangement allows you to add additional blocks before and after the category top menu, but you can't manipulate the category menu unless you edit the _renderCategoryMenuItemHtml function of Mage/Catalog/Block/Navigation.php. At best, you end up with a local copy of Mage/Catalog/Block/Navigation.php.

In Magento 1.7, page.xml still adds a topmenu block to the default scope. This time though, topmenu maintains a menu tree variable. This tree is populated by Catalog/Model/Observer.php's addCatalogToTopmenuItems function.

Additionally, the topmenu dispatches before and after events as it puts together its menu tree.

These mechanism enhancements from 1.6 to 1.7 allow extensions to cleanly manipulate the menu in accordance with Magento best practices.

NVNCBL Menu Builder is such an extension that is an interface for the topmenu menu tree. With it, you can create your own custom links in top menu, which can be any of categories, CMS pages, products, or a completely custom link.

Leave a Reply


Quick Support