We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28042 ☆ A M B ☆
    • 24,524 Posts
    It is, Ryan; names were changed to protect the innocent.
      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
      • 25663 MODX Staff
      • 12,272 Posts
      I figured wink, but I’m wondering why we don’t make this a stock part of the codebase. There’s clearly a use for it, and it could be made optional. smiley
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Ah, I see what you mean. No, I hard-coded a loop for the specific customization. But you are correct, it could be done that way easily enough. Or even use a chunk or TV in the snippet option for the list might be better.
          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
          • 30223
          • 1,010 Posts
          Quote from: rthrash at Oct 17, 2006, 01:17 AM

          I figured wink, but I’m wondering why we don’t make this a stock part of the codebase. There’s clearly a use for it, and it could be made optional. smiley

          Just popping in at the right moment smiley Yeah, I totally agree.. I’m just about to have my testing session... I will add something like this to the code.

          What should happen if you have $_SESSION and $_POST var with the same name you think? Which should take precedence?
            • 25663 MODX Staff
            • 12,272 Posts
            I’d tend to put the priority as an additional parameter, or even better, pull the prefix the placeholder with ’sn’ like [+snMyPlaceholder+] to mean explicitly pull the one from the session and [+MyPlacehoder+] to get the one from the POST (in the event there were two)... just a thought... I don’t know really! lol
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              I like that idea, Ryan, although in my case I have custom values stored in the session, in a sub-array, and the code loops through the sub-array. So it would be a little complicated, needing logic to know to loop if the value given is itself an array. Interesting.
                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
                • 32963
                • 1,732 Posts
                I’m not sure about the security implications of using session variables inside a form but I would say that session variables should take precedence over post variables.

                  xWisdom
                  www.xwisdomhtml.com
                  The fear of the Lord is the beginning of wisdom:
                  MODx Co-Founder - Create and do more with less.
                  • 30223
                  • 1,010 Posts
                  Quote from: xwisdom at Oct 17, 2006, 09:22 AM

                  I’m not sure about the security implications of using session variables inside a form but I would say that session variables should take precedence over post variables.

                  Yes, you’re right and you would only hope that people would consider those implications before using it (and properly validate vales) but I can see great advantages in being able to transport values from one form to another for instance.

                  I’ve added it in to the final 1.4 version which I’ll be uploading to the repository tomorrow. I’ve made session vars to take precedence unless set otherwise by (yet another) parameter
                    • 30223
                    • 1,010 Posts
                    I’ve added the final 1.4 version to the repository.

                    For a list of all changes see the repository or in the support topic.
                      • 7455
                      • 2,204 Posts
                      maybe add email as tag i search for email in repository but it did not come up
                        follow me on twitter: @dimmy01