We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30022
    • 3 Posts
    I have been making my own cms for an online business but I wanted to look around to see what is there. I have built two Joomla sites but it si so hard to make anything for Joomla. The Joomla documentation is so poorly done that I have trouble writing stuff on y own.

    Here is my questions, if I wanted to create a document (just a new document) can I embed php code into that document??? If so how can I do it.

    Another question is that I was looking for some good documentation on eformparser, is there any?

    Thanks
    timgerr
      • 33372
      • 1,611 Posts
      In MODx the usual way to embed PHP code into a document is to create a snippet (http://modxcms.com/snippets.html).

      eFormParse was a temporary branch from the main eForm snippet. Its features have now been included in the latest version of eForm. You can find eForm in the Repository (http://modxcms.com/resources.html).

      If you want to learn about snippet use, you may as well start with eForm (although that’s a pretty advanced and powerful snippet, so if you find it confusing try something simple first, like this: http://modxcms.com/AuthorTimestamp-693.html).
        "Things are not what they appear to be; nor are they otherwise." - Buddha

        "Well, gee, Buddha - that wasn't very helpful..." - ZAP

        Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
        • 30022
        • 3 Posts
        ok, I have createed a snipit
        snipit information

        Name = [[echo]]
        <?php
             echo $Passed_Information;
        ?>
        

        so I then create a new document and use the [[echo]] command. how can I pass informationin a document to the snipit?

        Thanks
        TIm
          • 33372
          • 1,611 Posts
          I’m not sure what you mean... What exactly is it that you’re trying to do?
            "Things are not what they appear to be; nor are they otherwise." - Buddha

            "Well, gee, Buddha - that wasn&#39;t very helpful..." - ZAP

            Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
            • 30022
            • 3 Posts
            Quote from: timgerr at Dec 14, 2006, 04:17 PM

            ok, I have createed a snipit
            snipit information

            Name = [[echo]]
            <?php
                 echo $Passed_Information;
            ?>
            

            so I then create a new document and use the [[echo]] command. how can I pass informationin a document to the snipit?

            Thanks
            TIm

            What I am saying is how can I pass information from within a document to a snipit? Like passing a variable.
              • 33372
              • 1,611 Posts
              OK. Well I’m still not sure what you need to do exactly, but I’ll take a stab. There are lots of ways to pass values to a snippet, so it really would help to know what you’re trying to accomplish...

              Anyway you can pass a variable/value combination like this:

              [[echo? &Passed_Information=`whatever you want to pass`]]

              That will set the value of $Passed_Information within the snippet.

              There are lots of ways to script those values in the snippet call, and of course if you want info that is part of the document object (or a TV, or pretty much anything else), then you don’t have to "pass" it to the snippet. You can access that info from within the snippet itself. There are standard methods that most people use to do a lot of these tasks, and then there are usually at least three other completely different but functionally equivalent methods that other people use (that’s the beauty of MODx).
                "Things are not what they appear to be; nor are they otherwise." - Buddha

                "Well, gee, Buddha - that wasn&#39;t very helpful..." - ZAP

                Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options