MIGX randomize not working with pthumb

I am using getPage to get an overview of pages from which the parent that have a migx image gallery.

In the chunk that contains the overview I have this code:
[[getImageList? &docid=[[+parent]] &limit=1 &randomize=1 &tvname=werkgever_fotogalerij &tpl=gr.vacatureImgOverview]]

The image that I load from the gallery in the chunk gr.vacatureImgOverview is:
[[+pagetitle:htmlent]]

The problem is that on the overview page it always loads the same images for every item.

Is there something I am missing?

Does it work if you call the snippet uncached (with a ![[!...]]) ?

Hi thanks for helping out. It did not work, I added it to the MIGX and pThumb

Can you maybe supply the whole code you’re using to output the images?
(For example from what you posted above, it’s unclear where and how pThumb is even used.)


Also, does it work correctly, if you output the images without using pThumb?

Hi,

First of all it also does not work without pthumb.

This is the code that I use in the overview page:

[[!getPage@Bikeshift?
&elementClass=modSnippet
&element=getResources
&pageVarKey=page
&parents=2
&where={"template:=":3}
&includeContent=1
&includeTVs=1
&processTVs=1
&showHidden=1
&tvFilters=vacature_plaats==%[[!#GET.city]]%,werkgever_naam==%[[!#GET.employer]]%,vacature_dienstverband==%[[!#GET.employment]]%,vacature_functie==%[[!#GET.functie]]%
&tvPrefix=``
&tpl=gr.vacatures2024
&sortby=RAND()
&depth=3
&limit=20
&totalVar=resultaten ]]

[[!If?
&subject=[[+resultaten]]
&operator=greaterthan
&operand=0
&then=[[+vacanciesResults]]
&else=<div class="col-12 pt-2 [[*werkgever_video:notempty=pb-5]]">[[$[[++oops_no_results_chunk]]]]</div>
]]

In the tpl (gr.vacatures2023) I call the random image like this:

[[getImageList? &docid=[[+parent]] &limit=1 &randomize=1 &tvname=werkgever_fotogalerij &tpl=gr.vacatureImgOverview]]

The tpl gr.vacatureImgOverview contains this code (I have added a space before img because otherwise it is not displayed well in this editor):

< img class=“w-100 h-auto” src=“[[!pthumb? &input=[[+werkgever_fotogalerij_afbeelding]] &options=w=696&h=460&aoe=1&zc=1]]” alt=“[[+pagetitle:htmlent]]”>

If you could edit your post and put all your code in code blocks, that would be helpful (and show all the back-ticks).
For a code block, put lines with three back-ticks at the start and at the end of your code.

```//line with 3 back-ticks at the beginning
//your code here
```//line with 3 back-ticks at the end

Also, try calling “getImageList” uncached → [[!getImageList?

you will need to call getImageList uncached and you need a unique snippet call each time, so try:

[[!getImageList? 
&docid=`[[+parent]]`
&limit=`1`
&randomize=`1` 
&tvname=`erkgever_fotogalerij` 
&tpl=`gr.vacatureImgOverview`
&my_unique_property=`[[+id]]`
]]

otherwise, you will allways get the result from the first call