1
Magento 1.9.1
Porto theme

We have a massive categories' menu bar at the top of the website with 14 long category names. It is taking way too much real estate space and we don't really need it other than on the front page. How can we hide it in all subsequent pages?

1

You could use layout XML to remove it from all pages, then add it again for just the homepage by either using the section under Admin->CMS->Pages->Edit->Design->Layout Update XML or by adding it to your local.xml using the handle <cms_index_index>.

In your theme's local.xml file:

<default>
    <reference name="top.menu">
        <action method="unsetChild"><name>catalog.topnav</name></action>
    </reference>
</default>
<cms_index_index>
    <reference name="top.menu">
            <label>Navigation Bar</label>
            <block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml" />
    </reference>
</cms_index_index>

This may have some debugging issues in regards to your custom theme. If so, turn on template hints to find the name of the file your menu is using, and you should be able to find similar layout instructions under app/design/frontend/your/theme/layout/SOME-FILE.xml, and you can change the name and/or template file appropriately.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.