1

I am trying to override the menu template file (which is located at app/design/frontend/rwd/default/template/page/html/topmenu.phtml) using the following

(file) default/layout/sean_menucreator.xml:

<page_html_index>
  <reference name="page.html.topmenu">         
        <action method="setTemplate">
            <template>sean_menucreator/page/html/topmenu.phtml</template>
       </action>
 </reference>
</page_html_index>

(file) default/template/sean_menucreator/page/html/topmenu.phtml

which outputs the menu built by its controller.

so because of the sean_menucreator.xml file that I have created then the template that is used should be

default/template/sean_menucreator/page/html/topmenu.phtml

but it's still

app/design/frontend/rwd/default/template/page/html/topmenu.phtml

(this is what the template hints that I turned on in the configuration told me)

I have tried putting the files in all the frontend subdirectories (base, default and rwd) just in case one takes precedence and that's why it isn't overriding but that doesn't seem to have helped

any help would be appreciated thank you.

1

I don't think there is any handle like page_html_index and there is any reference name like page.html.topmenu, are you sure you are using correct handles and block names ?

Anyway if you want to override any package's (base or default or rwd) topmenu template then you need to put below code in your module's layout update xml file (sean_menucreator.xml):

<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
    <default>
        <reference name="catalog.topnav">
            <action method="setTemplate">
                <template>sean_menucreator/page/html/topmenu.phtml</template>
            </action>
        </reference>
    </default>
</layout>

Also you have to put your custom topmenu template in same package(rwd) or in the "base" package, as Magento first looks for the template in same package if it doesn't find then it looks into base package.

Refer this for better understanding.

Hope this helps you out.

  • @seanyt123 If this answer resolved your issue, please mark it as accepted, or if you still have issue, then post in the comments here. Marking the answer accepted will help others resolve this issue when they encounter it. – Vicky Dev Dec 22 '15 at 4:37

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.