We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19419
    • 4 Posts
    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.
      • 28042 ☆ 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?
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 19419
        • 4 Posts
        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.
          • 33968
          • 863 Posts
          Where are the images coming from? A folder? Template variables? Where are you trying to display them?

          Bit unsure of what you’re doing... would you post your snippet here? Then we might be able to give you a better answer smiley