Repeat Selection on a recordset using Dynamic Parameters
I've got a page that uses the Accordion .js to display event data from a recordset in a repeat region. Inside each repeat region is a dynamic thumbnail image in a Repeat Selection behavior set to show a set of 8 images with recordset navigation. This works fine in the first repeat region but in subsequent ones, the filtering I've used is only calling the last image from the first set of 8 in the previous loop. The original query looks like this:
SELECT events.idevents, events.eventStatus, events.eventStatusID, event_album.idevent_album, event_album.eventID, event_album.eventImgURL, event_album.eventImgWdth, event_album.eventImgHt, event_album.eventImgAlt, event_album.eventImgThumbURL, event_album.eventImgThmbWdth, event_album.eventImgThmbHt, event_album.eventImgThmbAlt, event_album.eventImgStatus, event_album.eventImgStatusID
FROM events, event_album
WHERE events.idevents = event_album.eventID AND event_album.eventImgStatusID = 1
As you can see the WHERE clause filters on the events.idevents = event_album.eventID. The eventImgStatusID is an on-off switch to enable or disable the display of each image.
I've tried adding a dynamic parameter named MMPhotoParam:
WHERE events.idevents = event_album.eventID AND event_album.eventID = MMPhotoParam AND event_album.eventImgStatusID = 1
The MMPhotoParam references $row_rsEventDtls['idevents'] from the EventDtls recordset which is prior to the current recordset. I set the parameter to use default value of 1 and this gives me the same results.
I've removed the events.idevents = event_album.eventID from the query and I get the same results, possibly because the default value for the parameter is 1, so I changed it to 0 and the page displays 8 thumbnails - 4 of the first image and 4 of the second image in the first loop. In the second loop only the 8th image in the first loop is displayed.
I'm sure that there's a way to write the query so that the data is displayed properly - perhaps I need to move the query inside the repeat region. Any help or advise on how to get this working would be greatly appreciated.