li class active
how to set class active in <li>
Code: Select all
<?php
$html = '<li><a'.( ($Url->whereAmI()=='home')?' class="active"':'').' href="'.$Site->homeLink().'">'.$Language->get('Home').'</a></li>';
$parents = $pagesParents[NO_PARENT_CHAR];
foreach($parents as $parent)
{
// Check if the parent is published
if( $parent->published() )
{
// Print the parent
$html .= '<li>';
$html .= '<a'.( ($parent->key()==$Url->slug())?' class="active"':'').' href="'.$parent->permalink().'">'.$parent->title().'</a>';
}
}
echo $html;
// OPTIONAL LOGIN BUTTON
?>
why its not working ?
custom css template.
its working if i am running in html format without adding any of bludit contents
its working if i am running in html format without adding any of bludit contents