mrN
mrN

Reputation: 3770

Magento change the top menu from header to sidebar

I recently started to develop on magento and it is really confusing. I decided to change the position of top-menu from the header.phtml to the main layout life.

SO I moved <?php echo $this->getChildHtml('topMenu') ?> from header.phtml to 2Columns-right.phtml and now the menu is not showing up.

Upvotes: 1

Views: 5609

Answers (1)

ceckoslab
ceckoslab

Reputation: 1189

If you have local.xml file in your theme, can you use this in your default handler:

<reference name="header">
    <action method="unsetChild"><name>topMenu</name></action>
</reference>
<reference name="right">
    <action method="insert"><blockName>top.menu</blockName></action>
</reference>

If you don't have local.xml file just create one in the layout folder of your theme and populate it with this content:

<?xml version="1.0"?>
<layout>
    <default>
        <reference name="header">
            <action method="unsetChild"><name>topMenu</name></action>
        </reference>
        <reference name="right">
            <action method="insert"><blockName>top.menu</blockName></action>
        </reference>
    </default>
</layout>

Revert the changes in header.phtml and 2columns-right.phtml Clear the cache and you are ready to go.

Upvotes: 2

Related Questions