carolinelecoq Posted June 11, 2014 Share Posted June 11, 2014 Hello, I'm using the module "tm categories" for my horizontal top menu.It displays all categories but i want to hide some from the menu (and keep category accessible with the URL).I think it's related to the tmcategories.php file in this line : public function getTree($resultParents, $resultIds, $maxDepth, $id_category = 1, $currentDepth = 0)How to indicate to exclude some categories id ?Thank you in advance for your help. Link to comment Share on other sites More sharing options...
PSfever.com Posted June 11, 2014 Share Posted June 11, 2014 Hi, how about using a if contiditon in tmcategories.tpl foreach statement? Link to comment Share on other sites More sharing options...
carolinelecoq Posted June 11, 2014 Author Share Posted June 11, 2014 Hello, thank you for your fast reply. i just tried to add this code in tmcategories.tpl at the beginning but it doesn't work: if ($category->id !=51){} Link to comment Share on other sites More sharing options...
carolinelecoq Posted June 11, 2014 Author Share Posted June 11, 2014 I think the solution is in this part of code (tmcategories.php)public function getTree($resultParents, $resultIds, $maxDepth, $id_category = 1, $currentDepth = 0) { global $link; $children = array(); if (isset($resultParents[$id_category]) AND sizeof($resultParents[$id_category]) AND ($maxDepth == 0 OR $currentDepth < $maxDepth)) foreach ($resultParents[$id_category] as $subcat) $children[] = $this->getTree($resultParents, $resultIds, $maxDepth, $subcat['id_category'], $currentDepth + 1); if (!isset($resultIds[$id_category])) return false; return array('id' => $id_category, 'link' => $link->getCategoryLink($id_category, $resultIds[$id_category]['link_rewrite']), 'name' => $resultIds[$id_category]['name'], 'desc'=> $resultIds[$id_category]['description'], 'children' => $children); } Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now