Tell me more ×
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It's 100% free, no registration required.

I think this is a quite common problem: There are normal products categories but also some additional CMS pages which could be included in the main shop navigation.

In some shops I have seen the solution, that content was put in a CMS block and the category switched to "display only CMS" block to resemble a navigation for the shop content.

But I do not think that this is a best practice.

Are there better workarounds in Community Edition? (I know there is a Enterprise Edition feature to do this).

Or is there a well-known open source module helping with that?

share|improve this question
1  
If you ask me, this is best practice. :-) – Fabian Blechschmidt May 21 at 9:33
Doh! @FabianBlechschmidt – Alex May 21 at 13:59

3 Answers

There's definitely no built-in possibility to do this. Also I don't see any quick and pretty way to achieve this without writing a module.

The problem is to determine which of CMS pages have to be included into menu.

In addition to the solution you just described I can also suggest creating a static block consisting of <li> nodes and then injecting it into catalog/navigation/top.phtml template of your theme. This will give admin an opportunity to control what pages will be included into menu. No quite nice approach also if you ask me.

Another approach may be to add one or two (before and after categories) child blocks to catalog.topnav and also pulling them in catalog/navigation/top.phtml template. Then the CMS page can be added to menu with Custom Layout Update. Not nice approach either.

I would also like to know if there's an existing extension which automates it.

share|improve this answer
I think it would be nice to add these blocks and change the template, so the base template is untouched – Fabian Blechschmidt May 21 at 11:42
1  
The second approach, with some before and after block sounds quite nice. – Alex May 21 at 14:01

One of the way is to create normal category and rewrite it to related CMS page using Catalog > URL Rewrite Management section.
For more:
http://www.magentocommerce.com/knowledge-base/entry/adding-page-links-in-the-navigation-bar

share|improve this answer
This is actually a quite amazing solution - it lacks a little bit of comfort, so it would be cool to have a module which sets up this kind of config automatically. Also what I do not like is that the link in <a href> tag is still the category name and then there is a redirect to the CMS page (for example) – Alex May 21 at 14:08

Starting with Magento CE 1.7 there is this event available page_block_html_topmenu_gethtml_before that allows you to add any items to the top menu.
For example it is used to add the categories to top menu in Mage_Catalog_Model_Observer::addCatalogToTopmenuItems().
The only constraint is that your top menu block should look like this in page.xml

<block type="core/text_list" name="top.menu" as="topMenu" translate="label">
    <label>Navigation Bar</label>
    <block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml"/>
</block> 

If your theme is somehow similar with the default theme for 1.7 you should be able to add links to the top menu using this event.
Note: in 1.7 the top menu is rendered by this template: page/html/topmenu.phtml.

share|improve this answer
remark: seems to be only available starting from 1.7 – Alex May 21 at 14:45
Thanks @Alex. I edited the answer. – Marius May 21 at 14:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.