Magento – Vertically Position Main Navigation on Home Page

navigationposition;

I have just designed a website for a client and i need your help with Magento's main navigation. Just to clarify i mean the navigation menu which shows 1st level categories once added which is horizontal in the header file, not the top links.

I need to move this nav into a div in the home page content if possible. I cant use the left sidebar to do so because the main content will wrap underneath the navigation as well as the rest of the page.
How would i do this?

I can mess around with the CSS in order to get it in a vertical list, but its just getting the navigation into the main content first!

Thanks

Best Answer

I would suggest using unsetChild and insert rather than remove and then having to create the block again. Oddly unsetChild takes the block alias set via as but insert takes the block name.

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

Using insert also gives you some more power as regards to positioning of the block etc as you can pass some more parameters.

public function insert($block, $siblingName = '', $after = false, $alias = '')

NOTE: the main functions you can use via layout xml can be found in Mage_Core_Block_Abstract

Related Topic