I have the same problem, I think. I want to call documents with one getResources call, but have each of them use a different template based on their parent. It’s not ideal for me to use only one template as the documents that get retrieved don’t all share the same fields or TVs.
The only solution I have found is to use the IF snippet or output filters. I’m using IF. So at this moment I have a template for my getResources call that has four IF calls in it. This makes my page load very slowly and I’m looking for a better way of achieving "our" goal. Just to give a picture: the page that uses the IF calls is about the same size as another page I have, that doesn’t use any IF calls. The page without the IF calls loads at least four times faster! When using Firebug to diagnose, both of the pages’ first GET are around 7kb in size. Page with IF calls loads it in 4,5 seconds (hrrrr....) and the page without it in less than one second. Not all of the difference is due to the IF calls, but a great deal of it. Removing the IF calls results in a load time under 2 seconds.
But for your consideration I’m going to leave the awful method here. I’m hoping that someone else could enlighten us with more optimized solution
Call:
[[!getResources?
&parents=`1,2,3,4`
&limit=`10`
&showHidden=`1`
&includeTVs=`1`
&processTVs=`1`
&includeContent=`1`
&tpl=`exampleTpl`]]
exampleTpl:
[[!If? &subject=`[[+parent]]` &operand=`1` &then=`contents of first tpl`]]
[[!If? &subject=`[[+parent]]` &operand=`2` &then=`contents of second tpl`]]
...