css - How to get Active Menu Item Highlighted in Joomla -


i have created css highlighting color of active menu in joomla, though color change working fine on hover, color not change in of active menu

any getaways !! note - have 1 more site in joomla 1.5 older version - there code works fine active menu color changes. however issue coming in joomla 2.5

css

.bluetabs li a:visited{ color: #ffffff;               } .bluetabs li a:hover{ text-decoration: underline; color: #ffffff; background:#b60205; text-decoration:none;               } .bluetabs li.selected{ background:#b60205; padding:0;              } .bluetabs li.selected a{ /*selected main tab style */  background:#b60205;   border-bottom-color: white;              }  .bluetabs li.selected a:hover{ /*selected main tab style */   text-decoration: none;               } 

this function wherein correctly defining selected menu too

    foreach($rows $row){         if(($lt+1) < $cnt ){             $maincls = "";         }else{             $maincls = "last ";         }         if($parentid == $row->id){             $class = $clsarray[$lt].'selected';         }else{             $class = $clsarray[$lt];         }     }     $list.='</ul>'; } echo $list; //echo $list_sub;     } 

the site name :- http://www.ecarloan.in however, checked through firebug, not taking 'li class=selected' in active menu, rather showing below :-

its not executing :-

 <li class="selected"> 

rather showing, code in active css sample active menu

<li class="item-101 current active"> <a href="/">discussion board</a> </li> 

the entire function code :-

foreach($rows $row){         if(($lt+1) < $cnt ){             $maincls = "";         }else{             $maincls = "last ";         }                if($parentid == $row->id){             $class = $clsarray[$lt].'selected ';         }else{             $class = $clsarray[$lt];         }         if($vid!="" , $row->id==8){          $list.=' <li class="'.$class.'"><a  href="dealer">service</a></li>';         }else{         $list.=' <li class="'.$class.'"><a  href="'.mosgetlinktop1($row).'">'.$row->name.'</a></li>';         }         }     $list.='</ul>'; } echo $list; //echo $list_sub; 

}

what believe main issue change of mod_mainmenu mod_menu in joomla! 1.6+.

this causes template override not executed.

you need change path templates/<your template>/html/mod_menu/default.php. note override of menus on site, if have more one.

if want override menu, can create layout override, can selectively apply components , modules. explained here.

note mod_mainmenu , mod_menu not same (e.g, current id given current item has been changed current class prevent w3c validation issues when more 1 menu displayed).

therefore, may need adjust template override code.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -