Jump to content

SOLVED - Applying sfHoverForce class to category parent in blockTopMenu


Recommended Posts

Hello all,

 

I've looked for days on forums to find an answer to this question, found posts with same question but never with an effective answer.

 

I'm using the sfHoverForce class in the blockTopmenu module to apply a specific color to the active page category in my top menu.

The problem is when the current page is a sub-category, the color is applied to the sub-category and not the Parent category...

I would like both parent and sub-category to be considered selected in order to have the sfHoverForce class applied to both of them...

 

I suppose it's got to do with this line in the blockTopMenu.php :

 

 

$children = Category::getChildren((int)$id_category, (int)$id_lang, true, (int)$id_shop);

$selected = ($this->page_name == 'category' && ((int)Tools::getValue('id_category') == $id_category)) ? ' class="sfHoverForce"' : '';

 

 

Is there a way to extend the selected state to both active category and parent category ?

 

In advance thank you for your help, I'm stuck ...

 

Olivier

Edited by inabeathead (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...
×
×
  • Create New...