Jump to content

Setting a class to each top menu item


Recommended Posts

Edit /modules/blocktopmenu/blocktopmenu.php and change

case 'SHOP':
	$selected = ($this->page_name == 'index' && ($this->context->shop->id == $id)) ? ' class="sfHover"' : '';
	$shop = new Shop((int)$id);
	if (Validate::isLoadedObject($shop))
	{
		$link = new Link;
		$this->_menu .= '<li'.$selected.'><a href="'.Tools::HtmlEntitiesUTF8($shop->getBaseURL()).'" title="'.$shop->name.'">'.$shop->name.'</a></li>'.PHP_EOL;
	}
	break;
case 'SHOP':
	$selected = ($this->page_name == 'index' && ($this->context->shop->id == $id)) ? ' class="sfHover"' : '';
	$shop = new Shop((int)$id);
	if (Validate::isLoadedObject($shop))
	{
		$link = new Link;
		$this->_menu .= '<li class="'.$id.'" '.$selected.'><a href="'.Tools::HtmlEntitiesUTF8($shop->getBaseURL()).'" title="'.$shop->name.'">'.$shop->name.'</a></li>'.PHP_EOL;
	}
	break;
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...