Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hierarchical Menus
#21
(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£.
Reply


Messages In This Thread
Hierarchical Menus - by mrdragonraaar - 2012-11-03, 12:59:46
RE: Hierarchical Menus - by Connie - 2012-11-03, 17:58:54
RE: Hierarchical Menus - by mrdragonraaar - 2012-11-03, 22:26:57
RE: Hierarchical Menus - by mvlcek - 2012-11-03, 23:23:28
RE: Hierarchical Menus - by mrdragonraaar - 2012-11-03, 23:29:02
RE: Hierarchical Menus - by Connie - 2012-11-04, 00:08:10
RE: Hierarchical Menus - by mrdragonraaar - 2012-11-04, 00:10:54
RE: Hierarchical Menus - by lakechicago - 2013-04-22, 21:11:42
RE: Hierarchical Menus - by phpman - 2013-09-30, 06:45:13
RE: Hierarchical Menus - by Carlos - 2012-11-03, 18:23:19
RE: Hierarchical Menus - by andy.storey - 2012-11-09, 07:37:19
RE: Hierarchical Menus - by xStranger - 2012-11-10, 23:27:13
RE: Hierarchical Menus - by mrdragonraaar - 2012-11-19, 09:42:34
RE: Hierarchical Menus - by Oleg06 - 2012-11-19, 17:45:22
RE: Hierarchical Menus - by miagrimm - 2013-01-29, 23:43:08
RE: Hierarchical Menus - by cyberianTiger - 2013-03-27, 15:42:15
RE: Hierarchical Menus - by jbcarey - 2013-04-05, 06:10:08
RE: Hierarchical Menus - by shawn_a - 2013-04-05, 07:46:53
RE: Hierarchical Menus - by jbcarey - 2013-04-05, 07:50:20
RE: Hierarchical Menus - by shawn_a - 2013-04-05, 09:17:10
RE: Hierarchical Menus - by jbcarey - 2013-04-07, 22:36:29
RE: Hierarchical Menus - by shawn_a - 2013-04-08, 00:15:27
RE: Hierarchical Menus - by jbcarey - 2013-04-08, 01:24:29
RE: Hierarchical Menus - by kclaytor - 2016-09-24, 23:57:13
RE: Hierarchical Menus - by Domi - 2020-06-30, 23:19:37
RE: Hierarchical Menus - by Oleg06 - 2020-06-30, 23:33:08
RE: Hierarchical Menus - by Domi - 2020-07-04, 05:13:30
RE: Hierarchical Menus - by jjancel - 2021-11-18, 08:46:15
RE: Hierarchical Menus - by tibbz - 2023-02-17, 06:27:08
RE: Hierarchical Menus - by multicolor - 2023-02-17, 07:36:51
RE: Hierarchical Menus - by mvlcek - 2023-02-18, 05:31:26



Users browsing this thread: 1 Guest(s)