views:

178

answers:

3

Hey, we're running Magento 1.4.0.1 and would like to hide active categories from the navigation. When we do this, the parent category's URL 404s but all the children categories' URLs are still valid.

i.e.

magentostore.ex/brands/company is valid
magentostore.ex/brands is not

We would like magentostore.ex/brands to point to a page, but we don't want a tab saying "Brands" in our top-level navigation.

How can we hide the parent from navigation while keeping it active? Thanks!

A: 

Have you tried going through the CMS and making a page with a SEF URL Identifier of "brands" ? That should achieve what you would like, if I'm understanding correctly.

melee
This is a good idea, but when the CMS page URL is the same as something that already exists, Magento will serve the pre-existing page (even if its a "Page not found" from the disabled category).
分かりますか
A: 

Well, it's a bit of a cop-out, but we just upgraded to 1.4.1.0 from 1.4.0.1 and the "Include in Navigation Menu" option has been returned to the Category properties. This solves our problem. We can now keep the category from appearing in the top-level navigation while retaining the possibility of a landing page. EDIT: JD's solution is a better solution.

分かりますか
A: 

Be very careful of rushing into an upgrade to 1.4.1.0 - there were some major changes, particularly to the Sales_Order modules. Any extensions that you have related to Orders may break.

One option is to create a version of the Mage_Catalog_Block_Navigation file under app/code/local and override the drawItem function to exclude that category from the navigation. It requires writing some PHP, but not particularly difficult to copy/paste the existing code and add your condition.

Something like this at the top of the function should work (keep in mind that this function is recursive... and check your regex!!)

if(preg_match('/\b(brands)/i',$category->getName())!=0){
        return '';
    }

Cheers, JD

Jonathan Day
This is it. Thank you!
分かりますか