I am using getresources to build a table of data. This is my getResources call:
[[!getResources?
&parents=`5`
&includeTVs=`1`
&processTVs=`1`
&tplPath=`[[++assets_path]]web_assets/chunks/`
&tpl=`@FILE table-capabilities.htm`
&includeContent=`1`
&depth=`0`
&limit=`99`
&offset=`1`
&sortby=`{"menuindex":"ASC"}`
]]
Here's what's in table-capabilities.htm (the cells with switch-table chunk in it are what I need help with):
<tr>
<td>[[+pagetitle]]</td>
<td>[[+tv.product-code]]</td>
<td>[[+tv.product-quantity]]</td>
<td>[[$switch-table? &input=`[[+tv.product-capability-static]]`]]</td>
<td>[[$switch-table? &input=`[[+tv.product-capability-contrast]]`]]</td>
</tr>
and I'm using a chunk called switch-table which has this code in it:
[[!switch?
&get=`[[+input]]`
&c1=`No` &do1=`<span class="label label-important"><i class="icon-remove icon-white"></i> No</span>`
&c2=`Yes` &do2=`<span class="label label-success"><i class="icon-ok icon-white"></i> Yes</span>`
&c3=`Refer` &do3=`<span class="label label-info"><i class="icon-share-alt icon-white"></i> Refer</span>`
&c4=`Alert` &do4=`<span class="label label-warning"><i class="icon-question-sign icon-white"></i> Alert!</span>`
&default=`<span class="label"><i class="icon-exclamation-sign icon-white"></i> Default</span>`
]]
So I am trying to use getresources to draw a table using switch in a chunk to style the data in the table, by passing it the placeholder as a variable. I've tried all manner of uncached calls for chunks, placeholders and snippets to try to get this to work however it seems to be either
Caching the first call so everything is "default"
Only executing the first condition of the switch snippet so everything after "no" doesn't show
Only executing the first condition on the first row of the getresources call, everything below is blank.
Any ideas how to get this working reliably? I could probably put the switch call in the table-capabilities.htm and it will work, but that's not really how things are supposed to work in MODx no?