We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11315
    • 32 Posts
    Actually I realized since I only needed one value from the array, I just set the placeholder to get that one value.

    And it works now! Yay!

    Thanks soooo much for all your help!
      • 18397
      • 3,250 Posts
      Anytime! Glad to hear its all working! If I may ask, what were you trying to create?
        • 11315
        • 32 Posts
        I was implementing this script, and wanted to see if I could just use snippets instead of uploading the files and all.

        Of course, if I hadn’t been able to in the end I would have just used the php files, but I like that I CAN use the snippets and keep everything all together.
          • 6726
          • 7,075 Posts
          Very interresting grelca, thanks for the input Mark gives me some ideas for future projects grin

          Amazing stuff...
            .: COO - Commerce Guys - Community Driven Innovation :.


            MODx est l'outil id
            • 32241
            • 1,495 Posts
            So far, that’s the only way to go, by using placeholder.

            If you want a cleaner or procedural process for the snippet or script, you can use $modx->runSnippet API from MODx.

            function runSnippet($snippetName, $params=array()) { ... }


            You can call some other snippet and pass necessary parameter for that snippet. Witht this, you don’t have to worry that your designer will put the snippet calling in wrong order, all the need to do is put the main snippet that will call and pass value to other snippet and process the output.

            Just my two cent
              Wendy Novianto
              [font=Verdana]PT DJAMOER Technology Media
              [font=Verdana]Xituz Media
              • 11315
              • 32 Posts
              Oh well the designer putting them in the wrong order isn’t a problem considering I am the designer anyway.:P

              And if I were to do that, would it output the called snippets output again?
                • 32241
                • 1,495 Posts
                Ehmn, what I have in mind is that, when you put the first snippet after the second snippet, then the second snippet that is suppose to receive input from the first snippet will receive an empty data on placeholder array, because it’s not being processed yet by the first anippet.

                But whichever it is, as long as it serve the purpose, then it’s done! Remember, there are so many way to Rome, same with MODx. You can achieve the same results with a lot of perspective and ways. So choose whic one that works the best for you. wink

                Sincerely,
                  Wendy Novianto
                  [font=Verdana]PT DJAMOER Technology Media
                  [font=Verdana]Xituz Media