I've got a list of variables stored in MIGX. They're promo lines like
"Buy one get one free"
"Buy before Saturday"
"It's raining"
"etc"
On the same page as the MIGX variable I've got a getResources call to show all the children. On each getResources result I want to show a promo line.
What I'd do outside of MODX (a php site) is
- Set a counter to 0
- count the number of items in the array of lines
- for each new child get the next line in the array
- if the line number exceeds the array count reset the counter to 0
I've tried set/get placeholders and $_SESSION but the item returned is always the last item in the array. I'm calling the snippet !uncached from the getResources tpl
Should these work or is there some other global variable variable that is persistent across the page?