Dropdown navigation onClick
Hello,
Im trying to make a dropdown navigation where the subitems (level_2) only show when clicked on its parent (level_1). This means I have to some how deactivate the level_1 link, kind of like the way that contao.orgĀ“s navigation is build, but with click instead of hovering. Make sense? Can anyone give me a clue on this? THANKS!
Christian
Re: Dropdown navigation onClick
Horizontal or Vertical?
You could modify the nav_default template so that the "a" has an href calling a javascript onclick if $this->level == 'level_1',
instead of its usual href="php echo $item['href'];"
The actual javascript called could be placed in the nav_default template too in the same "if" block (so it is only written once when level_1 is processed)
The tricky part is finding the right javascript to call - or writing it.