Quote from: jisaac at Apr 12, 2018, 10:08 PM
I would love to accomplish this with a single call in either Wayfinder or pdoMenu because those maintaining this project are not the most technical. Appreciate any advice or input you can provide.
Hi,
here is one example solution for two level menu - two column mega menu will be added for one of menu items:
1.
Menu chunk with pdoMenu call:
<div class="right-aligned-menu" id="navigation">
[[pdoMenu?
&level=`2`
&countChildren=`1`
&parents=`0`
&includeTVs=`menuSupport,subMenu`
&tvPrefix=`wf_`
&parentClass=`menu-item-has-children `
&outerClass=`navigation-menu nav`
&tplOuter=`@INLINE <ul [[+classes]] id="menu">[[+wrapper]]</ul>`
&tplInner=`@INLINE <ul class="submenu ">[[+wrapper]]</ul>`
&tplParentRow=`menuParentRowTpl`
]]
</div>
2.
menuParentRowTpl chunk:
<li [[+classes]]>
<a class="dropdown-toggle" data-toggle="dropdown" href="[[+link]]" [[+attributes]]>
[[+menutitle]]
</a>
[[#[[+id]].tv.ShowAsMegaMenu:isequalto=`1`:then=`
[[$twoColumnList?parent=`[[+id]]`&children=`[[+children]]`]]
`:else=`[[+wrapper]]`]]
</li>
3.
ShowAsMegaMenu TV here is applied to any top level menu resource where mega menu is needed.
4.
twoColumnList chunk:
<ul class="submenu megamenu">
<li class="menu-item-has-children">
<ul class="sub-menu">
[[pdoResources?
&parents=`[[+parent]]`
&depth=`1`
&tpl=`menuInnerTpl`
&select=`{"modResource":"id,pagetitle,alias,uri"}`
&limit=`[[+children:add:div=`2`]]`
&sortby=`{"menuindex":"ASC"}`
]]
</ul>
</li>
<li class="menu-item-has-children">
<ul class="sub-menu">
[[pdoResources?
&parents=`[[+parent]]`
&depth=`1`
&tpl=`menuInnerTpl`
&select=`{"modResource":"id,pagetitle,alias,uri"}`
&offset=`[[+children:add:div=`2`]]`
&sortby=`{"menuindex":"ASC"}`
]]
</ul>
</li>
</ul>
5.
menuInnerTpl chunk
<li[[+classes]]><a href="[[+uri]]">[[+pagetitle]]</a></li>