Hi! I’m new here and in Modx. But I’m happy using it and being here!
I’ve a question
I’ve a snippet that generates dynamic images and strings. I want to mantain an array with a number of them. If the array has ten elements, they are moving up when a new one incomes. I’ve tried to do with ten placeholders but my snippets are uncached and can’t get in the next call. Also I think that cannot do it with template variables because (I believe) that I can read them but can’t change them in a snippet. Could anybody give me a suggestion.
Thanks in advance.
-
☆ A M B ☆
- 24,524 Posts
What do you want it to do when a new one gets generated? If the array holds 10 image/string sets, what should happen when an 11th is generated?
The one is the newest element, the ten is the oldest one. When a new element arrives, the ten is erased, the nine is moved to ten and so on. Then the new element just arrived is the one.