Jump to content

Disable category link


Recommended Posts

it's not possible to share "universal" solution in this case,

it's because categories ID numbers are different for each shop.

 

if we want to remove these links (href="") we need to know ID of category and modify module php file.

sadly, this is the only one module where contents are generated inside the .php file - so we need to alter php file

 

there is also some workaround, to remove href="" param with jquery,

but in this case it will remove href from EACH first level menu item

Link to comment
Share on other sites

Hi,

I modify blocktopmenu.php from :

 

case 'CMS_CAT':
$category = new CMSCategory((int)$id, (int)$id_lang);
if (count($category))
{
$this->_menu .= '<li><a href="'.Tools::HtmlEntitiesUTF8($category->getLink()).'" title="'.$category->name.'">'.$category->name.'</a>';
$this->getCMSMenuItems($category->id);
$this->_menu .= '</li>'.PHP_EOL;
}
break;
 
 
TO:
 
case 'CMS_CAT':
$category = new CMSCategory((int)$id, (int)$id_lang);
if (count($category))
{
$this->_menu .= '<li><a href="#" title="'.$category->name.'">'.$category->name.'</a>';
$this->getCMSMenuItems($category->id);
$this->_menu .= '</li>'.PHP_EOL;
}
break;
 
On PS 1.6 and It looks to run OK.
 
Can you, please, confirm this is the right way ???
Link to comment
Share on other sites

×
×
  • Create New...