Community

Ordering images indepedent to other images of other folders

Is it possible to order a gallery consisting of images of different folders and order these images of each folder independend to the other images of the other folders?
(see image below)

I use the following call to collect the different projects:

[[getResources? &parents=[[*id]] &depth=2 &sortby={"parent":"","menuindex":"ASC"} &tpl=projectImageTplFull &limit=0 &showHidden=1 &includeTVs=1 &processTVs=1 &resources=-4,-7,-40,-53]]

Then I use the following call to collect all images of each individual project:

[[!getImageList? &tvname=projectBrancheImage &sortby=menuindex &sortdir=DESC &depth=1 &limit=1 &tpl=@CODE:<img src="[[+image]]" alt="[[+alt]]" /> &docid=[[+id]] ]]

I can’t get controll over this.

Could someone help me out?

regards,

Roderik

I think the easiest way to do this is just to make 4 different getResources calls, one for each resource. Then you can order them as you have in the diagram.

It might be possible to order by parent, I am not sure

That seems like a fairly… magical way of wanting the sort to work. Why not just sort consistently 1-8, and let the client decide on the exact order by dragging the resources into the right order in the tree?

This probably works:

[[!getImageList? 
  &tvname=`projectBrancheImage`
  &sortby=`menuindex`
  &sortdir=`[[+idx:mod=`2`:eq=`0`:then=`DESC`:else=`ASC`]]`
  &depth=`1` 
  &limit=`1` 
  &tpl=`@CODE:<img src="[[+image]]" alt="[[+alt]]" />`
  &docid=`[[+id]]`
]]

Every 2nd item will be sorted descending (8-1), while the others are ascending (1-8).