1

Does anyone known if it is possible to move top.menu to its own structural reference through local.xml ?

By default it is inserted in header.phtml

I have removed the callout from header.phtml and inserted it in the page layout files (1column,3columns etc) directly below the header call.

   <?php echo $this->getChildHtml('topMenu') ?>

In local.xml i have then added

    <reference name="header">
        <action method="unsetChild"><name>topMenu</name></action>
    </reference>

I would usually then add the reference name where i want it to go but as top.menu resided within header by default it does not have its own structural reference.

I tried adding it as topMenu but ofcourse this failed as the reference doesnt exist.

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

Would anyone know a solution to this.

p.s. i am using magento 1.8.1.0

1 Answer 1

0

I have removed the callout from header.phtml and inserted it in the page layout files (1column,3columns etc) directly below the header call.

Then you will have to make topMenu block a children of root block.

What I did in my project was to add a <block> children of root block in page.xml.

Using <update> tag.

Check this: https://stackoverflow.com/questions/7661107/what-does-the-update-element-do-in-magento-layout-xml

So you would could also solve it in local.xml:

<default>
    <reference name="root">
       <update handle="topMenu" />
    </reference>
</default>
3
  • Thanks but i already tried the root reference infact it was the first method i tried. I have also used page.xml to do this before but i'm looking to do all edits in local.xml. Commented Apr 12, 2014 at 9:23
  • Couldnt get this to work through local.xml alone so in the end i built a layout module. The update tag does seem to be answer its just figuring out how to structure it. I dont have enough time to play with it currently but i will revisit this when i do as it would be so much easier to do everything through local.xml. Thanks again ! Commented Apr 14, 2014 at 12:14
  • Glad you solved that! You're welcome.
    – Niloct
    Commented Apr 14, 2014 at 16:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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