Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How to remove category link from top-menu? 
 
l781
Sr. Member
 
Total Posts:  109
Joined:  2008-11-09
 

I have question - maybe somebody can give for me advice?

I need remove link from top menu: last but one number of category should not have hyper-link (hope my english is ok with this explession?).
In picture there ar shown my situation - is there a work-around?

So, user can-not click on category, if this category has subcategory-child.

Is this a CSS question or there is PHP coding required?

Image Attachments
disable_category_question.JPG
 
Magento Community Magento Community
Magento Community
Magento Community
 
l781
Sr. Member
 
Total Posts:  109
Joined:  2008-11-09
 

bump…

any ideas how to “lock” submenu “Kavinems” if there is submenu...? (see images on #1 post)

thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Raptor Commerce (Matt)
Member
 
Total Posts:  49
Joined:  2009-08-10
 

You’d need to extend Mage_Catalog_Block_Navigation and override the drawItem() function. Basically wrap the href generation in a conditional block so

$html.= '<a href="'.$this->getCategoryUrl($category).'"><span>'.$this->htmlEscape($category->getName()).'</span></a>'."\n";

becomes

if ($hasChildren{
    $html
.= '<a href="'.$this->getCategoryUrl($category).'"><span>'.$this->htmlEscape($category->getName()).'</span></a>'."\n";
}
if (else) {
    $html
.= '<span>'.$this->htmlEscape($category->getName()).'</span>'."\n";
}

Pretty simple really grin

 
Magento Community Magento Community
Magento Community
Magento Community
 
stratokrlos
Jr. Member
 
Total Posts:  6
Joined:  2012-10-11
 

Can you explain better this please!.. i have teh same problem but i dont know how to do that

 
Magento Community Magento Community
Magento Community
Magento Community
 
stratokrlos
Jr. Member
 
Total Posts:  6
Joined:  2012-10-11
 

Hi Monty22

Unfortunate no, i have the same issue that the frist post i have this categorys

ALIMENTOS - JUGUETES - ACCESORIOS - HIGIENE - SERVICIOS (look the image)

the mother categorys are those… i need that the mother category appear but NO link, if a costumer click there dont do anything, not even refresh the page

but the children one ..  (Perros - Gatos) have links and funtion normaly ..

Image Attachments
Category.JPG
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top