0

I have been directed to use categories (subcategories & url reqwrite) but I don't like that every link after 'HOME' is a sub of 'HOME'

I also can't seem to be able to find any pages, static blocks or categories linked to the 'HOME' Button. Only a page, which doesn't affect the button text itself.

enter image description here

enter image description here

1 Answer 1

0

It is unclear what Home and New Page really is. Hence I assume they are two categories that exists in your Magento instance.

In default RWD Theme which is available in Magento 1.9, only active categories will be added to topmenu section. This means that you can see only categories (which are active) by default in topmenu section. CMS Pages and static blocks will not be available as a topmenu item unless you have added them to topmenu section manually.

From your vague question, I think you have basically two questions.

How can I add a category as a sub-item of another category ?

This is how Men menu and it's children look like in default RWD theme

Magento RWD Theme - Topmenu

See the category settings in admin corresponding Men Category

Category Tree in Admin

As you can see, Men Category comes under Default Category. All sibling menu items of Men Category similarly comes directly under Default Category. You can also see, all sub-menu items of Men menu item is actually sub-categories of Men Category.

This is what you need to do in this case. If you need to make a sub-menu item for Home, then you need to put New Page as a sub-category of Home category.

How can I add a new topmenu Item ?

Magento provides two events to add your custom topmenu items in topmenu tree. They are :

  • page_block_html_topmenu_gethtml_before
  • page_block_html_topmenu_gethtml_after

If you do a close inspection, Mage_Catalog module is observing to the event page_block_html_topmenu_gethtml_before and adding categories as topmenu items via observer. You can use this classic example to create your own custom menu tree and then add it to the topmenu tree. All you need to do is observe to this either of these events and add your menu item.

You can add a CMS Page as a topmenu item or any other custom page as topmenu item using these events.

4
  • Thanks for taking the time to answer this. As I say I am new to a lot of this and so i'm finding it hard to properly word and understand the questions i need answering. I have updated my original question with another screenshot, which will hopefully shed more light on my confusion with 'home' and 'new page' As you can see, New Page, is a sub category of 'default' as you explained. I am confused as to why 'Home' doesn't show up as a category or sub category..
    – 704
    Oct 6, 2015 at 2:41
  • @Angelo what is home actually ? is that a cms page or a category ? I cant see home as a category in your screen-shot Oct 6, 2015 at 2:43
  • This is why I am confused.. 'home' button was included with the theme I am editing. But I was expecting it to show as a subcategory. I think it is a CMS page which was installed by the theme.
    – 704
    Oct 6, 2015 at 2:47
  • @Angelo in default theme, there is no cms page included as menu item. I think Home is included by your custom theme. As I noted, they may be using the events I described above to add home page as menu. You need to dig it out Oct 6, 2015 at 2:50

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.