Wrap pdoresources result with a div

Is there a way to wrap each result of pdoresources with a div? I am using bootstrap grid and dont want to include e.g. .col classes inside my item template because I am using it on different pages with different grids.

Thanks!

Can’t you just use a second chunk. Maybe one that includes your “item template”:

[[pdoResources?
    ...
    &tpl=`extendedItemTemplate`
]]

Chunk “extendedItemTemplate”

<div>[[$defaultItemTemplate]]</div>

Or you could add some logic to your “item template” and add a custom property to your snippet call:

[[pdoResources?
    ...
    &tpl=`defaultItemTemplate`
    &myCustomProperty=`1`
]]

Chunk “defaultItemTemplate”

{if $myCustomProperty == 1 }<div>{/if}
<!-- normal chunk content as before -->
{if $myCustomProperty == 1 }</div>{/if}
1 Like

The second chunk is an option, yes.
I will try the solution with the custom property!

Thanks for your help!

1 Like

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.