.dropdown:hover>ul{display:block}
My Wayfinder call:
[[Wayfinder? &startId=`0` &level=`0` &outerTpl=`mmouterTPL` &rowTpl=`mmrowTPL` &rowClass=dropdown &hereClass=active ]]
The mmrowTPL (you have to have the Switch Extra installed):
[[!switch? &get=`[[+isfolder]]` &c1=`0` &do1=`<li[[+wf.classes]]><a href="[[+wf.link]]">[[+wf.linktext]]</a>` &c2=`1` &do2=`<li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#">[[+wf.linktext]] <b class="caret"></b></a> [[Wayfinder?&startId=`[[+wf.docid]]`&outerTpl=`mminnerTPL`&rowTpl=`mminnerrowTPL`]] </li>` &default=`<li[[+wf.classes]]><a href="[[+wf.link]]">[[+wf.linktext]]</a>` ]]
My little fix for mmrowTPL
<li [[+wf.classes]]> <a class="dropdown-toggle" [[!switch? &get=`[[+isfolder]]` &c1=`1` &do1=`data-toggle="dropdown"` &default=``]] href="[[+wf.link]]" [[+wf.attributes]]>[[+wf.linktext]] [[!switch? &get=`[[+hasChildren]]` &c1=`1` &do1=`<b class="caret"></b>` &default=``]] </a> [[Wayfinder?&startId=`[[+wf.docid]]`&outerTpl=`mminnerTPL`&rowTpl=`mminnerrowTPL`]] </li>
this makes being a container does not have the ability to click (title), on the contrary and having children can follow a link.
Regards! [ed. note: erloko last edited this post 10 years, 5 months ago.]
You can do it with one wayfinder call. Lighter than the previous solution in the resource cache
Wayfinder call:
[[Wayfinder? &startId=`0` &level=`2` &outerTpl=`NavbarOuter` &rowTpl=`NavbarRow` &activeParentRowTpl=`NavbarActiveParentRow` &parentRowTpl=`NavbarParentRow` &innerTpl=`NavbarInner` &innerRowTpl=`NavbarInnerRow` &firstClass=`` &lastClass=`` &removeNewLines=`1`]]
NavbarOuter:
<ul class="nav navbar-nav">[[+wf.wrapper]]</ul>
NavbarRow:
<li[[+wf.classes]]><a href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]="">[[+wf.linktext]]</a>[[+wf.wrapper]]
NavbarParentRow:
<li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="#" title="[[+wf.title]]">[[+wf.linktext]] <b class="caret"></b></a>[[+wf.wrapper]]</li>
NavbarActiveParentRow:
<li class="dropdown active"><a class="dropdown-toggle" data-toggle="dropdown" href="#" title="[[+wf.title]]">[[+wf.linktext]] <b class="caret"></b></a>[[+wf.wrapper]]</li>
NavbarInner:
<ul class="dropdown-menu">[[+wf.wrapper]]</ul>
NavbarInnerRow:
<li class="divider"></li> <li[[+wf.classes]]><a href="[[+wf.link]]">[[+wf.linktext]]</a>
With a custom css rule:
.dropdown-menu li.divider:first-child { display: none; }
</li[[+wf.classes]]></li[[+wf.classes]]>
<nav class="collapse navbar-collapse bs-navbar-collapse pull-right"role="navigation"> <ul class="nav navbar-nav"> <li><!-- missing class="dropdown"--> <a href="index.php?id=3" title="Insurance">Insurance</a> <!-- missing href="#" class="dropdown-toggle" data-toggle="dropdown"--> <ul class="dropdown-menu"> <li class="divider"></li> <!-- href="#" class="dropdown-toggle" data-toggle="dropdown"--> <li><a href="index.php?id=2">Auto</a></li><li class="divider"></li> <li><a href="index.php?id=5">Auto2</a></li> </ul> </li> <li> <a href="index.php?id=4" title="Compare Rates">Compare Rates</a> </li> </ul> </nav>
[[Wayfinder? &startId=`0` &level=`2` &outerClass=`nav navbar-nav` &innerClass=`dropdown-menu` &hereClass=`active` &rowTpl=`menuNavbarRow` &innerRowTpl=`menuNavbarSubmenu` ]]
<li class="[[+wf.classnames]][[+wf.isfolder:is=`1`:then=` dropdown`]]"> <a href="[[+wf.isfolder:is=`1`:then=`#`:else=`[[+wf.link]]`]]" title="[[+wf.title]]" [[+wf.isfolder:is=`1`:then=`class="dropdown-toggle" data-toggle="dropdown"`]] [[+wf.attributes]]>[[+wf.linktext]] [[+wf.isfolder:is=`1`:then=`<b class="caret"></b>`]] </a> [[+wf.wrapper]] </li>
<li class="dropdown-submenu"><a href="[[+wf.link]]" [[+wf.attributes]]>[[+wf.linktext]]</a>[[+wf.wrapper]]</li>
Bootstrap 3 navbar menu
[[Wayfinder? &startId=`0` &level=`2` &outerClass=`nav navbar-nav` &innerClass=`dropdown-menu` &hereClass=`active` &rowTpl=`menuNavbarRow` &innerRowTpl=`menuNavbarSubmenu` ]]
Chunk menuNavbarRow
<li class="[[+wf.classnames]][[+wf.isfolder:is=`1`:then=` dropdown`]]"> <a href="[[+wf.isfolder:is=`1`:then=`#`:else=`[[+wf.link]]`]]" title="[[+wf.title]]" [[+wf.isfolder:is="`1`:then=`class="dropdown-toggle"" data-toggle="dropdown" `]]="" [[+wf.attributes]]="">[[+wf.linktext]] [[+wf.isfolder:is=`1`:then=`<b class="caret"></b>`]] </a> [[+wf.wrapper]] </li>
Chunk menuNavbarSubmenu
<li class="dropdown-submenu"><a href="[[+wf.link]]" [[+wf.attributes]]="">[[+wf.linktext]]</a>[[+wf.wrapper]]</li>
Bootstrap 3 navbar menu
[[Wayfinder? &startId=`0` &level=`2` &outerClass=`nav navbar-nav` &innerClass=`dropdown-menu` &hereClass=`active` &rowTpl=`menuNavbarRow` &innerRowTpl=`menuNavbarSubmenu` ]]
Chunk menuNavbarRow
<li class="[[+wf.classnames]][[+wf.isfolder:is=`1`:then=` dropdown`]]"> <a href="[[+wf.isfolder:is=`1`:then=`#`:else=`[[+wf.link]]`]]" title="[[+wf.title]]" [[+wf.isfolder:is="`1`:then=`class="dropdown-toggle"" data-toggle="dropdown" `]]="" [[+wf.attributes]]="">[[+wf.linktext]] [[+wf.isfolder:is=`1`:then=`<b class="caret"></b>`]] </a> [[+wf.wrapper]] </li>
Chunk menuNavbarSubmenu
<li class="dropdown-submenu"><a href="[[+wf.link]]" [[+wf.attributes]]="">[[+wf.linktext]]</a>[[+wf.wrapper]]</li>