Hi,
I am trying to set up a call in wayfinder so i can process this html, but I am totally stuck.
<!--Wayfinder.outerTpl -->
<ul class="nav navbar-nav">
<!-- Wayfinder.parentRowTpl -->
<li class="first dropdown yamm-fw">
<a href="#" title="" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">megamenu Level 1<b class="caret"></b></a>
<!--Wayfinder.innerTpl -->
<ul class="dropdown-menu ">
<!-- Yamm start tags -->
<li>
<div class="yamm-content">
<div class="row">
<dl class="col-sm-3 mega-menu">
<!-- Wayfinder.categoryFoldersTpl -->
<dt class="first"><a href="#">Level 2 container</a></dt>
<!--Wayfinder.innerTpl -->
<dd class="first"><a href="#">Child on level 3</a></dd>
<dd><a href="#">Child on level 3</a></dd>
<dd class="last"><a href="#">Child on level 3</a></dd>
</dl>
<dl class="col-sm-3 mega-menu">
<dt class=""><a href="#">Level 2 container</a></dt>
<dd class="first"><a href="#">Child on level 3</a></dd>
<dd><a href="#">Child on level 3</a></dd>
<dd><a href="#">Child on level 3</a></dd>
<dd><a href="#">Child on level 3</a></dd>
<dd><a href="#">Child on level 3</a></dd>
<dd class="last"><a href="#">Child on level 3</a></dd>
</dl>
<dl class="col-sm-3 mega-menu">
<dt class=""><a href="#">Level 2 container</a></dt>
<dd class="first"><a href="#">Child on level 3</a></dd>
<dd><a href="#">Child on level 3</a></dd>
<dd class="last"><a href="#">Child on level 3</a></dd>
</dl>
<dl class="col-sm-3 mega-menu">
<dt class="">
<a href="#">Level 2 container</a></dt>
<dd class="first"><a href="#">Child on level 3</a></dd>
<dd><a href="#">Child on level 3</a></dd>
<dd><a href="#">Child on level 3</a></dd>
<dd class="last"><a href="#">Child on level 3</a></dd>
</dl>
</div>
</div>
</li>
<!--yamm end tags-->
</ul>
</li>
<li class=" dropdown"><a href="#" title="Referanser" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
Standard Level 1<b class="caret"></b></a>
<ul class="dropdown-menu">
<li class="first"><a href="#">Level 2</a></li>
<li><a href="#">Level 2</a></li>
<li><a href="#">Level 2</a></li>
<li> <a href="#">Level 2</a></li>
</ul>
</li>
</ul>
url:
http://codepen.io/murias/pen/dYREwe
Here are my wayfinder tpl's and call
[[Wayfinder?
&startId=`0`
&level=`4`
&outerTpl=`Wayfinder.outerTpl`
&parentRowTpl=`Wayfinder.parentRowTpl`
&innerRowTpl=`Wayfinder.innerRowTpl`
&innerTpl=`Wayfinder.innerTpl`
&categoryFoldersTpl=`Wayfinder.categoryFoldersTpl`
&rowTpl=`Wayfinder.rowTpl`
&where=`[{"class_key:=": "modDocument"}]`
&debug=`0`
]]
<!-- outerTpl -->
<ul class="nav navbar-nav">[[+wf.wrapper]]</ul>
<!-- parentRowTpl -->
<li class="[[+wf.classnames]] dropdown [[+wf.docid:is=`2`:then=`yamm-fw`]]"><a href="[[If? &subject=`[[++bootstrap.dropdown_disabled]]` &operand=`1` &then=`[[+wf.link]]` &else=`#`]]" title="[[+wf.title]]" class="dropdown-toggle [[If? &subject=`[[++bootstrap.dropdown_disabled]]` &operand=`1` &then=`disabled`]]" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" [[+wf.attributes]] >
[[+wf.linktext]]<b class="caret"></b></a>
[[+wf.wrapper]]
</li>
<!-- categoryFoldersTpl -->
<dl class="col-sm-3 mega-menu">
<dt [[+wf.classes]]><a href="[[+wf.link]]" [[+wf.attributes]]>[[+wf.linktext]]</a></dt>
[[+wf.wrapper]]
</dl>
<!-- innerTpl-->
[[+wf.isFolder:is=`1`:then=`
<ul class="dropdown-menu">
<li>
<div class="yamm-content"><div class="row">
[[+wf.wrapper]]
</div></div>
</li>
</ul>
`:else=`
<ul class="dropdown-menu">[[+wf.wrapper]]</ul>
`]]
<!-- innerRowTpl -->
<!-- innerRowTpl -->
[[+wf.docid:is=`2`:then=`
<dd [[+wf.classes]]><a href="[[+wf.link]]" [[+wf.attributes]]>[[+wf.linktext]]</a></dd>
`:else=`
<li [[+wf.classes]]>
<a href="[[+wf.link]]" [[+wf.attributes]]>[[+wf.linktext]]</a>
</li>
`]]
I only want a megamenu when toplevel is docid=2.
On level 2 I have used rel="category", so I can use the categoryFoldersTpl. Also this is a container.
I suspect that my innerTpl and innerRowTpl does not work as intended, but how can i fix it? Or is it even possible to process all in a wayfinder call?
This is my output for the call:
<!-- outerTpl -->
<ul class="nav navbar-nav">
<!-- parentRowTpl -->
<li class="first dropdown yamm-fw"><a href="#" title="" class="dropdown-toggle " data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
Megamenu Level 1<b class="caret"></b></a>
<!-- innerTpl-->
<ul class="dropdown-menu">
<!-- categoryFoldersTpl -->
<dl class="col-sm-3 mega-menu">
<dt class="first"><a href="index.php?id=8" rel="category">Level 2 container</a></dt>
<!-- innerTpl-->
<ul class="dropdown-menu">
<!-- innerRowTpl -->
<li class="first">
<a href="index.php?id=40">Level 3</a>
</li>
<!-- innerRowTpl -->
<li><a href="index.php?id=9">Level 3</a></li>
<!-- innerRowTpl -->
<li><a href="index.php?id=10">Level 3</a></li>
<!-- innerRowTpl -->
<li class="last"> <a href="index.php?id=21">Level 3</a></li>
</ul>
</dl>
<!-- categoryFoldersTpl -->
<dl class="col-sm-3 mega-menu">
<dt><a href="index.php?id=19" rel="category">Level 2 container</a></dt>
</dl>
<!-- categoryFoldersTpl -->
<dl class="col-sm-3 mega-menu">
<dt><a href="index.php?id=20" rel="category">Level 2 container</a></dt>
</dl>
<!-- categoryFoldersTpl -->
<dl class="col-sm-3 mega-menu">
<dt class="last"><a href="index.php?id=41" rel="category">Level 2 container</a></dt>
<!-- innerTpl-->
<ul class="dropdown-menu">
<!-- innerRowTpl -->
<li class="first"> <a href="index.php?id=12">Level 3</a></li>
<!-- innerRowTpl -->
<li><a href="index.php?id=11">Level 3</a></li>
<!-- innerRowTpl -->
<li> <a href="index.php?id=13">Level 2</a></li>
</ul>
</dl>
</ul>
</li>
<!-- parentRowTpl -->
<li class=" dropdown "><a href="#" title="Referanser" class="dropdown-toggle " data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
Standard Level 1<b class="caret"></b></a>
<!-- innerTpl-->
<ul class="dropdown-menu">
<!-- innerRowTpl -->
<li class="first"><a href="#">Level 2</a></li>
<!-- innerRowTpl -->
<li><a href="#">Level 2</a></li>
<!-- innerRowTpl -->
<li><a href="#">Level 2</a></li>
<!-- innerRowTpl -->
<li class="last"><a href="#">Level 2</a></li>
</ul>
</li>
</ul>
[ed. note: murias last edited this post 9 years, 3 months ago.]