Hi all, given discussion earlier, have been reviewing an accordion menu set-up I was going to use, though the client changed their mind. I was just experimenting and found that this single accordion stack works fine until I try to set the start id to anything but 0 or try to exclude some documents, thoughts?
For completeness
accordionInner
<ul class="element">[+wf.wrapper+]</ul>
accordionOuter
<div id="accordion"><ul>[+wf.wrapper+]</ul></div>
accordionParentRow
<li class="toggler [+wf.classnames+]">[+wf.linktext+][+wf.wrapper+]</li>
accordionRow
<li><a href="[+wf.link+]" title="[+wf.title+]" [+wf.attributes+] [+wf.classes+]>[+wf.linktext+]</a>[+wf.wrapper+]</li>
Wayfinder call
[!Wayfinder? &startId=`0` &level=`2` &ignoreHidden=`FALSE` &outerTpl=`accordionOuter` &innerTpl=`accordionInner` &parentRowTpl=`accordionParentRow` &rowTpl=`accordionRow`!]
js
<script type="text/javascript">
window.addEvent('domready', function() {
var accordion = new Accordion('li.toggler', 'ul.element', {
opacity: false,
onActive: function(toggler, element) {
toggler.setStyle('css-style', 'value');
},
onBackground: function(toggler, element) {
toggler.setStyle('css-style', 'value');
},
display: 'all closed'
}, $('accordion'));
});
</script>
I’ve ignored the css for clarity.
Regards