nimaesalehi Posted December 26, 2012 Share Posted December 26, 2012 (edited) Any body knows how to add proper condition for if that contains false condition in this code to apply changes only for first node of categories? blocktopmenu.php > Line:640 if (!empty($is_intersected)) { if (false){ $this->_menu .= '<dd id="3" '.$selected.'>'; $this->_menu .= '<a href="'.$category_link.'">'.$category->name.'</a>'; } else{ $this->_menu .= '<li class="medb" id="3" '.$selected.'>'; $this->_menu .= '<a class="norm five area-christmas" href="'.$category_link.'">'.$category->name.'</a>'; $this->_menu .='<div class="pos1b">'; } if (count($children)) { $this->_menu .= '<dl>'; foreach ($children as $child) $this->getCategory((int)$child['id_category'], (int)$id_lang, (int)$child['id_shop']); $this->_menu .= '</dl>'; } if(false){ $this->_menu .= '</dd>'; } else{ $this->_menu .= '</div></li>'; } } } it generates this tags <ul id="menu"> <li class="medb" id="3" ><a class="norm five area-christmas" href="http://localhost/projects_prestashop/prestashop_1.5.2.0/13911006/index.php?id_category=3&controller=category">iPods</a> <div class="pos1b"></div> </li> <li class="medb" id="3" ><a class="norm five area-christmas" href="http://localhost/projects_prestashop/prestashop_1.5.2.0/13911006/index.php?id_category=4&controller=category">Accessories</a> <div class="pos1b"></div> </li> <li class="medb" id="3" ><a class="norm five area-christmas" href="http://localhost/projects_prestashop/prestashop_1.5.2.0/13911006/index.php?id_category=5&controller=category">Laptops</a> <div class="pos1b"></div> </li> <li class="medb" id="3" > <a class="norm five area-christmas" href="http://localhost/projects_prestashop/prestashop_1.5.2.0/13911006/index.php?id_category=6&controller=category">Christmas</a> <div class="pos1b"> <dl> <li class="medb" id="3" > <a class="norm five area-christmas" href="http://localhost/projects_prestashop/prestashop_1.5.2.0/13911006/index.php?id_category=7&controller=category">highlight</a> <div class="pos1b"> <dl> <li class="medb" id="3" ><a class="norm five area-christmas" href="http://localhost/projects_prestashop/prestashop_1.5.2.0/13911006/index.php?id_category=8&controller=category">Gifts they'll love</a> <div class="pos1b"></div> </li> </dl> </div> </li> <li class="medb" id="3" > <a class="norm five area-christmas" href="http://localhost/projects_prestashop/prestashop_1.5.2.0/13911006/index.php?id_category=9&controller=category">Gift Ideas</a> <div class="pos1b"> <dl> <li class="medb" id="3" > <a class="norm five area-christmas" href="http://localhost/projects_prestashop/prestashop_1.5.2.0/13911006/index.php?id_category=10&controller=category">Hampers</a> <div class="pos1b"></div> </li> </dl> </div> </li> </dl> </div> </li> </ul> But i need it applyed only for first node Edited December 26, 2012 by nimaesalehi (see edit history) 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