I have some code where i need to insert a class called active within the link tag. But for some really weird reason it wont work even though the values match and it really should only make the beef menu item blue and not the others. Screenshot attached.
if($menuitems->title==$menutitle) {
$activemenu='active';
}
echo '<a href="#menu_'.$cid.'" class="list-group-item list-group-item-success '.$activemenu.'" data-toggle="collapse" data-parent="#MainMenu" >'.$menuitems->title.' / '.$menutitle.' / '.$menuitems->title.'</a>';
$menu->title does only equal beef but yet its inseting teh active classs intoall the other top level menus.
Thanks for your help :) Jonny
Aucun commentaire:
Enregistrer un commentaire