I'm updating an old magento install and I just upgraded it from
1.4.1 (to 1.4.2 first) to 1.9.
Now the top navigation menu doesn't show anymore. The category structure is still intact. I've tried several tutorials online on how to display the top navigation menu, but none worked so far.
I'm following this tutorial..http://www.magentocommerce.com/wiki/4_-_themes_and_template_customization/navigation/add_home_link_to_menu_bar
I'm looking inside
app/design/frontend/default/yourtheme/template/catalog/navigation/top.phtml
But the file isn't being parsed, I can put nonsense php statements inside it and don't get any error messages on the site. I've disabled compilation and all cache on the site.
How can I get this working? Or normally where is this file called from?
Edit1: I see now that in
app/design/frontend/default/yourtheme/template/page/html/header.phtml
the top menu is called..
<?php echo $this->getChildHtml('topMenu') ?>
But this string is empty. I've added topmenu.phtml
to
app/design/frontend/default/yourtheme/template/page/html/
This file isn't called as well. I don't know why this isn't working, any advice is welcome.
Edit2
The content of top.menu
is empty, I'd like to get this fixed first. I've tried to call it in several ways..
$this->getLayout()->getBlock('top.menu')->toHtml()
or
$layout = Mage::app()->getLayout();
$layout->getUpdate()
->addHandle('default')
->load();
$layout->generateXml()
->generateBlocks();
var_dump( $layout->getBlock('top.menu')->toHtml());
Edit3
I wanted to know where the top.menu
is filled, I've found two files
app/code/core/Mage/Page/Block/Html/Topmenu.php
app/code/core/Mage/Page/Block/Html/TopMenu/Renderer.php
The functions in both classes aren't called, even though I'm using
<?php echo $this->getChildHtml('topMenu') ?>
in a file that gets parsed. So I'm wondering am I calling the right method to display the top menu? Or am I looking at the wrong files?
Best Answer
After a lot of searching I found out that my template missed the reference to top.menu. So I copied catalog.xml from app/design/frontend/default/default/layout to design/frontend/default/mytemplate/layout