We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 606
    • 5 Posts
    I have read the documentation and information on snippets however I can’t seem to get a basic contact page to work. Can someone please help?

    In addition, where should the source code for snippets be placed when adding it to a page?

    Thank You,

    Pat
      • 25663 MODX Staff
      • 12,272 Posts
      Have you tried the built-in contact page that ships with MODx 0.9.0?
        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
        Quote from: agape25 at Nov 22, 2005, 12:35 AM

        In addition, where should the source code for snippets be placed when adding it to a page?

        The source code for a snippet is placed in a new Snippet in the Manager. The [[SnipppetName? &options=value]] tags are placed wherever you want the snippet’s output to occur.
          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
          • 606
          • 5 Posts
          Thank you for your quick reply and please excuse my ignorance but how do I install the built in contact page that came with the program?

          PS sorry for posting to the wrong section of the forum. Is there a way to remove this message from this section and place it in the correct section?
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Zi will move it if he’s not happy with where it is wink

            When you unzipped the MODx package, in the Install folder you will find .tpl files with all of the default snippets. Just create a new snippet in the Manager, and copy/paste the text from the .tpl file you want. The names are case-sensitive; it has to be the same when you call the snippet. The contact form is snippet.contactform.tpl.

            If the snippet’s already installed, you don’t have to do that.

            Now, in the document you’re using as the Contact Us page, just call the ContactForm snippet:

            [[ContactForm? &sendTo=`[(emailsender)]`]]
              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