We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14779
    • 256 Posts
    I am trying to add an email address field to the standard usercomments snippet. I created a chunk called ’guestbookdisplaytpl’ and a chunk called ’guestbookformtpl’. Here is the code:

    guestbookdisplaytpl:
    [+UID:[+uid+]+]<div[+postclass+]>
    <div[+numberclass+]>
    [+postnumber+]
    </div>
    <div[+titleclass+]>
    <strong>[+subject+]</strong><span>[+user+], [+email+]; [+createdon+]</span> <!-- Added Email reference -->
    </div>
    <div class="content">
    [+comment+]
    </div>

    </div>

    guestbookformtpl:
    <form method="post" action="[~[*id*]~]">
    <input name="[+tagname+]" type="hidden" value="on" />
    Email Address:
    <input name="email" type="text" size="30" />
    <!-- Added Email Field -->
    Subject:
    <input name="subject" type="text" size="40" value="" />

    Comment:
    <textarea name="comment" cols="50" rows="8"></textarea>

    <input name="send" type="submit" value="Submit" />
    </form>

    The code I am using to call this is:
    [[UserComments? &makefolder=’1’ &formtpl=’guestbookformtpl’ &displaytpl=’guestbookdisplaytpl’ ]]

    For some reason, the usercomments snippet will not accept the &displaytpl and the &formtpl arguments. The form on my page does not show the email address field.
    What is wrong here?

    -Joshua
      PM me to find out how you can get a FREE ipad 2!
      • 26435
      • 1,193 Posts
      Follow the instructions here:
      http://modxdev.net/usercommentssnippet.html

      that should answer your questions.

      -sD-
        Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
        All of the above... in no specific order.


        I send pointless little messages
        • 33337
        • 3,975 Posts
        These are not single quotes laugh but back ticks ( ` ), the key right under "Esc" key, before "1" on standard keyboard.

        regards,

        zi
          Zaigham R - MODX Professional | Skype | Email | Twitter

          Digging the interwebs for #MODX gems and bringing it to you. modx.link
          • 31601
          • 57 Posts
          I’m having the exact same problem. The output is not reflecting even the change I made in the display template to the class of the comment:

          Here’s what I have:

          display template:

          [+UID:[+uid+]+]<div[+postclass+]>
          <div[+numberclass+]>
          [+postnumber+]
          </div>
          <div[+titleclass+]>
          <strong>[+subject+]</strong><span>[+user+] [+createdon+]</span>
          </div>
          <div class="commentbody">
          [+comment+]
          </div>
          </div>

          Call of comments snippet:

          [!UserComments? &canpost=`RegisteredUsers` &displaytpl=`CommentsDisplay` &postcss=`commentpost` &titlecss=`commenttitle` &numbecss=`commentnumber`!]

          Even the change of the class where the comment is displayed isn’t reflecting in the output! PLEASE somebody let me know what’s wrong here- I’ve poured over the documentation that has been referenced many times, and I still cannot get this to output so I can style the comments!