IDX condition in a getresource tpl

285 Views Asked by At

I use getresource like this:

[[!getResources? &tpl=`coffrets_id` &parents=`1115`]]

inside coffrets_id tpl I'd like to be able to do something like this:

[[+idx:is=`1`:then=`show only first getressrouce result`:else=``]]
[[+idx:is=`2`:then=`show only second getressrouce result`:else=``]]
[[+idx:is=`3`:then=`show only third getressrouce result`:else=``]]...

but I have no idea how to show only the result that matches the idx. Is there any solution?

1

There are 1 best solutions below

0
On

Just use Templating Properties

[[!getResources? 
    &tpl=`coffrets_id` 
    &tpl_1=`coffrets_id_1` 
    &tpl_2=`coffrets_id_2` 
    &tpl_3=`coffrets_id_3` 
    &parents=`1115`
]]