I am trying to change the html of my navigation bar ( like adding some div tags etc ) but not getting it how to do this so far i did this.

I know template for top menu is topmenu.phtml and it is using the file app/code/core/Mage/Catalog/Block/Navigation.php. So as we should not change the core files i copied this file to the directory app/code/local/Mage/Catalog/Block/Navigation.php.

Now the change i am doing here is not reflecting in the frontend i have tried refreshing the cache already.

It woul be great if anybody can tell me about the various actions here and which action to edit for changing the html of topmenu navigation bar i have 3 level categories i.e level-0,level-1 and level-2.

Thanks in advance

2 Answers 2


Since the template does nothing but call the block method (getMenuHtml()) to render the HTML, you might be best off to just replace the navigation template with your own block and template that does what you wish. By doing this you isolate any changes from default into their own files/module and you avoid having to rewrite core files.

There are a million ways to do a better job than the core team when it comes to this specific block. Giving someone a template that does nothing but call a method that renders unseen HTML is hardly even a template in the first place. Just replace it.


I've searched in app/code/core/Mage/Catalog/. There is no Navigation.php

There is a Navigation.php in app/code/core/Mage/Catalog/Block/Navigation.php

So you should override it in app/code/local/Mage/Catalog/Block/Navigation.php

  • Hi Nikitas thanks i just typed the wrong path of file here i have actually placed it inside the Block and even then it's not working thanks once again now i have edited my question
    – Sarvagya
    Commented Dec 2, 2013 at 7:07

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.