1

I am trying to change the position of top links. I want to move top.menu before top.links.
In my page.xml following code is given:

            <block type="page/html_header" name="header" as="header">
                <block type="page/template_links" name="top.links" as="topLinks"/>
                <block type="page/switch" name="store_language" as="store_language" template="page/switch/languages.phtml"/>
                <block type="core/text_list" name="top.menu" as="topMenu" translate="label">
                    <label>Navigation Bar</label>
                    <block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml"/>
                </block>
                <block type="page/html_welcome" name="welcome" as="welcome"/>
            </block>

And I have changed it as following to move top.menu above:

            <block type="page/html_header" name="header" as="header">
                <block type="page/switch" name="store_language" as="store_language" template="page/switch/languages.phtml"/>
                <block type="core/text_list" name="top.menu" as="topMenu" translate="label">
                    <label>Navigation Bar</label>
                    <block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml"/>
                </block>
                <block type="page/template_links" name="top.links" as="topLinks"/>
                <block type="page/html_welcome" name="welcome" as="welcome"/>
            </block>
2

These are child block of header so you you have to change it in app/design/frontend/namespace/theme/template/page/html/header.php change position of this child block <?php echo $this->getChildHtml('topMenu') ?> move before <?php echo $this->getChildHtml('topLinks') ?>

1

Replace your code with below code

<block type="page/html_header" name="header" as="header">
                <block type="page/switch" name="store_language" as="store_language" template="page/switch/languages.phtml"/>
                <block type="core/text_list" name="top.menu" as="topMenu" before="top.links" translate="label">
                    <label>Navigation Bar</label>
                    <block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml"/>
                </block>
                <block type="page/template_links" name="top.links" as="topLinks" after="top.menu"/>
                <block type="page/html_welcome" name="welcome" as="welcome"/>
            </block>

Hope this will help you!

  • Exactly, I have done this but it doesn't work. I have cleared cache. – Triyugi Narayan Mani Apr 27 '16 at 7:41

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.