Hello,
I'm having a nasty issue with getResources that I hope someone can help me address. I'm using it to generate Bootstrap rows. Each row has 2 columns, so the general output form is:
<div class="row">
<div class="col-xs-6">
[[resource goes here]]
</div>
<div class="col-xs-6">
[[next resource goes here]]
</div>
</div>
So if there are n elements returned by getResources, there will be n/2 rows, each with 2 columns (the last row will have just one column if there's an odd number of resources).
To achieve this, I've used getResources this way:
<div class="row"> <!-- first row -->
[[!getResources? &parents=`[[*id]]`
&limit=`0`
&tpl=`myTpl`
&tpl_n3=`n3Tpl`
&includeTVs=`1`
&processTVs=`1`
&includeContent=`1`
&sortby=`menuindex`
&sortdir=`asc`
&depth=`1` ]]
</div> <!-- last row -->
myTpl just has <div class="col-xs-6"> [[resource]] </div> in it. n3Tpl has this:
</div> <!-- end of current row div -->
<div class="row"> <!-- start of next row div -->
[[$myTpl? &idx=`[[+idx]]` ]] <!-- using the idx= trick to prevent caching issues -->
My problem is that when there are 5 resources returned by getResources, it applies n3Tpl to the third resource, which is correct, but not to the 5th--the last resource always is generated using myTpl. I really need it to generate using n3Tpl. I have no idea why it's using myTpl. I've tried setting &tplLast=``, with no effect.
Am I doing something wrong? Help would be so greatly appreciated!
Thank you SO much in advance!
[ed. note: pltarr last edited this post 9 years, 4 months ago.]