I've just written a small custom menu module for a site I'm working on, and need it to replace the current base/default catalog.topnav
. My module's config.xml
looks like this:
<?xml version="1.0"?>
<config>
<modules>
<Magz_MyMenu>
<version>0.1.0</version>
</Magz_MyMenu>
</modules>
<frontend>
<layout>
<updates>
<mymenu module="mymenu">
<file>magz_mymenu.xml</file>
</mymenu>
</updates>
</layout>
</frontend>
<global>
...
<blocks>
<page>
<rewrite>
<html_topmenu>Magz_MyMenu_Block_Html_Topmenu</html_topmenu>
</rewrite>
</page>
</blocks>
...
</global>
</config>
... and my layout update file magz_mymenu.xml is as follows:
<?xml version="1.0"?>
<layout>
<default>
<reference name="top.menu">
<action method="unsetChild"><name>catalog.topnav</name></action>
<block type="page/html_topmenu" name="catalog.topnav" template="magz/page/html/topmenu.phtml"/>
</reference>
</default>
</layout>
Now this currently works and renders as it should on the frontend, but I want to know:
- Am I doing this correctly?
- Is there a difference between
action method="unsetChild"
andremove name=
?
Thank you