Pdoressource and conditional template

Hi,
i’m trying to make a gallery with image and video and i have to use diferent html block for each type of ressources

I have 2 solution in mind :

1.retreave a ressource list and apply some template conditioning like if ressource use this template then use chunk1 to show result else use chunk2

or
2.maybe this is possible : can i use pdoressources and use template of each ressources to process the result

1 Like

Yes and yes, both are fine.

You are going to need to pick a tool (Extra) to do the grabbing of the list of images and videos anyway…pdoresources is one option.

And, you could certainly put conditional chunks in there, or target the different resources through css perhaps

Thanks, i try to understand some functionnality i see in PdoRessources but i can’t figure out how it works.
https://docs.modx.pro/en/components/pdotools/snippets/pdoresources

&tplCondition
&conditionalTpls

those sound good
i will dig this way

1 Like

Ok good, and remember you can always switch to another tool for a basic function like this, if it is easier to work with, to get your specific requirements. There are many in this domain!

Keep in touch we are really doing great in this new forum at supporting users! The old forum btw is still an excellent resource to search through. Modx stays consistent so even 6+ year old posts are directly useful, and even older posts are often perfectly fine as well.

&context could also help, if you want to pick up the different files based on context

Also often you can just make multiple calls for the different resources, then just specify the different templates in those calls…but there are many ways to achieve this result