2010年5月3日星期一

Make Category Nav Menu Show up in your Magento Homepage | Code Stash

I have installed Magento in my system. And I got into a good start, but I stumbled into an obstacle along the way. I wanted to show the Top Nav Menu on my home page.

This was a tricky one, I read a guide that taught me how to add the Home link in the menu bar of themain template. you have to add some code to one of the template files.

Find the file called top.phtml inapp/design/frontend/default/default/template/catalog/navigation/ and make the following change:

01.
class="code">
02.
class="header-nav-container">
03.
class="header-nav">
04.

class="no-display">echo $this->__('Category Navigation:') ?>

05.
    "nav">
06.
07.
09.
10.
11.foreach ($this->getStoreCategories() as $_category):?>
12.echo $this->drawItem($_category) ?>
13.endforeach ?>
14.
15.echo $this->getChildHtml('topLeftLinks') ?>

And you got the Home link in your main navigation.

home link

But this, did not show the categories on my Nav Menu just yet. Given that you have created a category under the root category. Make sure all categories are active. If a top level category is inactive the ones below will not show. Then, add products to you categories. After that follow the instructions:

  1. go to System > Manage Stores
  2. click the “Main Website Store” link under Store Name
  3. make sure the dropdown for “Root Category *” is set to you top level catergory. In my case, it was “All Products”

After this, the categories will be showing up on the main navigation. Together with the Home link, if you followed our first steps.

magento nav

P.S. I have to thank mediagang for this too.. thanks a lot for the help.



Make Category Nav Menu Show up in your Magento Homepage | Code Stash

没有评论:

发表评论