From 48d899741aebc4631a5ad38eb2115da658153032 Mon Sep 17 00:00:00 2001 From: Axome Date: Wed, 22 Oct 2014 10:15:41 +0200 Subject: [PATCH 1/3] [*]MO add category id in categories items Usefull for customization --- blocktopmenu.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/blocktopmenu.php b/blocktopmenu.php index 1230a04..743ee50 100644 --- a/blocktopmenu.php +++ b/blocktopmenu.php @@ -608,8 +608,15 @@ private function generateCategoriesMenu($categories, $is_children = 0) else $link = $this->context->link->getPageLink('index'); - $html .= 'page_name == 'category' - && (int)Tools::getValue('id_category') == (int)$category['id_category']) ? ' class="sfHoverForce"' : '').'>'; + $li_classes = array(); + + if ($this->page_name == 'category' && Tools::getValue('id_category') == $category['id_category']) + $li_classes[] = 'sfHoverForce'; + + $li_classes[] = 'category'.$category['id_category']; + + $html .= ''; + $html .= ''.$category['name'].''; if (isset($category['children']) && !empty($category['children'])) From d147b2016dce052b7f5f404a648f85639c0b82c7 Mon Sep 17 00:00:00 2001 From: Axome Date: Wed, 13 May 2015 11:26:00 +0200 Subject: [PATCH 2/3] [*] MO : blocktopmenu : Force int cast on id_category --- blocktopmenu.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blocktopmenu.php b/blocktopmenu.php index 743ee50..9c3ebad 100644 --- a/blocktopmenu.php +++ b/blocktopmenu.php @@ -610,10 +610,10 @@ private function generateCategoriesMenu($categories, $is_children = 0) $li_classes = array(); - if ($this->page_name == 'category' && Tools::getValue('id_category') == $category['id_category']) + if ($this->page_name == 'category' && (int)Tools::getValue('id_category') == (int)$category['id_category']) $li_classes[] = 'sfHoverForce'; - $li_classes[] = 'category'.$category['id_category']; + $li_classes[] = 'category'.(int)$category['id_category']; $html .= ''; From 665819ea6572974a806773f6135008c761f4e4b0 Mon Sep 17 00:00:00 2001 From: Axome Date: Wed, 13 May 2015 11:26:18 +0200 Subject: [PATCH 3/3] Update blocktopmenu.php --- blocktopmenu.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/blocktopmenu.php b/blocktopmenu.php index 9c3ebad..af0622d 100644 --- a/blocktopmenu.php +++ b/blocktopmenu.php @@ -608,12 +608,10 @@ private function generateCategoriesMenu($categories, $is_children = 0) else $link = $this->context->link->getPageLink('index'); - $li_classes = array(); + $li_classes = array('category'.(int)$category['id_category']); if ($this->page_name == 'category' && (int)Tools::getValue('id_category') == (int)$category['id_category']) $li_classes[] = 'sfHoverForce'; - - $li_classes[] = 'category'.(int)$category['id_category']; $html .= '';