Hi there,
I'm trying to use nested snippets so that if there are no children then nothing is displayed.
Within a Wayfinder chunk, this returns a value for each item:
[[getChildCount? &parent=`[[+wf.docid]]`]]
But this code always shows the ELSE output code and I think it's because I'm trying to run one snippet inside another:
[[If? &subject=`[[getChildCount? &parent=`[[+wf.docid]]`]]` &operator=`NEQ` &operand=`0` &then=`
<li[[+wf.id]][[+wf.classes]]>
<h2>[[+wf.linktext]] .[[getChildCount? &parent=`[[+wf.docid]]`]]</h2>
<ul class="block-list group">
[[msProducts? &parents=`[[+wf.docid]]` &limit=`4`]]
</ul>
[[If? &subject=`[[getChildCount? &parent=`[[+wf.docid]]`]]` &operator=`GT` &operand=`4` &then=`<a href="[[+wf.link]]" [[+wf.attributes]]>View all [[+wf.linktext]]</a>`]]
</li>
` &else=`[[+wf.linktext]] [[getChildCount? &parent=`[[+wf.docid]]`]]
`]]
It doesn't seem to matter whether I use NEQ or GT.
Do I need to create a new snippet that uses runSnippet and if so, how would this work?
Thanks,
David