2013-04-08, 01:24:29
(2013-04-08, 00:15:27)shawn_a Wrote:PHP Code:$ismenu = false;
$caret = $dropdown = $dropdown_list = '';
$classStr = $item->classes;
$classes = explode(' ',$item->classes);
if(in_array('current',$classes)) $classStr .= ' active';
if(in_array('currentpath',$classes)) $classStr .= ' active';
if($item->hasChildren and ($item->isOpen or $ismenu==true)){
if(in_array('open',$classes)) $classStr .= ' dropdown';
$dropdown = 'data-toggle="dropdown" class="dropdown-toggle"';
$dropdown_list = ' class="dropdown-menu"';
$caret = '<b class="caret"></b>';
$classStr = str_replace('open','',$classStr);
}
?>
<li class="<?php echo $classStr; ?>">
<a href="<?php echo htmlspecialchars($item->link) . "\""; echo ' '.$dropdown; ?> >
<?php
# debugLog(htmlspecialchars($item->text));
echo htmlspecialchars($item->text); echo $caret
?>
</a>
<?php if ($item->isOpen) { ?>
<ul<?php echo $dropdown_list.'>'; $item->outputChildren(); ?></ul>
<?php } ?>
</li>
I added an active classs to 3.2 so that piece may no longer be needed.
Hope it gets you started somewhere.
oh wow!! this works PERFECTLY!! thank you so much£.