We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3296
    • 16 Posts
    On the website http://desertmessenger.myphotos.cc/modx/
    I have the following inserted into the page using the html editor.
    I would prefer to be able to place it on a page using a snippet.
    Can someone explain how to do this step by step?

    The phplist is active and accepting subscriptions. It will send out emails to subscribers when I test email templates. So if you test it remember to unsubscribe unless you want to get a test template from me.
    --------------
    <!-- newsletter copy script below here -->
    <table border="0">
    <tbody>
    <tr>
    <td style="text-align:center; font-size:11px;" width="140">Bicycle Rider Announcement Newsletter

    <!-- newsletter subscribe below here -->
    <script type="text/javascript">// <![CDATA[

    var fieldstocheck = new Array();
    fieldnames = new Array();
    function checkform() {
    for (i=0;i<fieldstocheck.length;i++) {
    if (eval("document.subscribeform.elements[’"+fieldstocheck[i]+"’].value") == "") {
    alert("Please enter your "+fieldnames[i]);
    eval("document.subscribeform.elements[’"+fieldstocheck[i]+"’].focus()");
    return false;
    }
    }
    return true;
    }
    function addFieldToCheck(value,name) {
    fieldstocheck[fieldstocheck.length] = value;
    fieldnames[fieldnames.length] = name;
    }
    // ]]></script>
    <form action="http://desertmessenger.myphotos.cc/lists/?p=subscribe" method="post">
    Email:<input name="email" type="text" />

    <script type="text/javascript">// <![CDATA[
    addFieldToCheck("email");
    // ]]></script>
    <input name="list[1]" type="hidden" value="signup" />
    <input onclick="return checkform();" name="subscribe" type="submit" value="Subscribe" />
    </form>
    <!-- newsletter subscribe ends here -->
    </td>
    </tr>
    </tbody>
    </table>
    <!-- newsletter copy script above here -->
    --------------
      • 1343 ☆ A M B ☆
      • 2,213 Posts
      Just create a new chunk and paste the above code in the chunk.

      Use {{chunkname}} to insert where desired.

      You make chunks under elements > manage elements > chunks.

      You don’t need to put this in a Snippet as it’s not PHP.
        Patrick | Server Wrangler
        About Me: Website | Tweets |  MODX Hosting
        • 3296
        • 16 Posts
        Thank you. could you give me a example of the line insert to past into that page?
          • 1343 ☆ A M B ☆
          • 2,213 Posts
          As noted in the above post you would use {{chunkname}} where you need that put.
            Patrick | Server Wrangler
            About Me: Website | Tweets |  MODX Hosting
            • 3296
            • 16 Posts
            Thanks Yes that worked just fine. Still learning and plugging along
              • 1343 ☆ A M B ☆
              • 2,213 Posts
              Glad to hear that worked for you.

              If you haven’t already check out: http://codingpad.maryspad.com/beginner-tutorials/ and http://bobsguides.com/MODx.html

              If you think of more questions ask away smiley
                Patrick | Server Wrangler
                About Me: Website | Tweets |  MODX Hosting