We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 312
    • 23 Posts
    Can anyone code an usercomment snippet which would have the following form fields

    Name
    email
    url
    comment

    the email will not be published
    The url will be the hyperlink for the name.
    An example will be http://abs.absabs.us

    I don’t want to have any anonymous comments and at the same time, I don’t to chase away people from commenting...
      Why do people point to their wrists when asking for the time, but don’t point to their crotch when they ask where the bathroom is?

      http://abs.absabs.us
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      I’m looking into it; it shouldn’t be too difficult; suggestions and ideas welcome.
        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
        • 18397
        • 3,250 Posts
        That is very simple to do smiley

        From a long lost piece of documentation:

        http://modxdev.net/usercommentssnippet.html

        (soon to be on the main modx site)
          • 312
          • 23 Posts
          question again. Suppose I want the email field as mandatory, how do i do it... For ex. if somebody is commenting, I want them to put down email to comment. If they dont put down email, then it should say please put down email...
            Why do people point to their wrists when asking for the time, but don’t point to their crotch when they ask where the bathroom is?

            http://abs.absabs.us
            • 18397
            • 3,250 Posts
            That would require a modification of the snippet.
              • 25663 MODX Staff
              • 12,272 Posts
              Here’s another question regarding UserComments:

              Can anyone think of an easy way to display the "most recent 5 comments" from a specific comments block, not located on the same page?
                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
                &folder=`xx` &recentposts=`5` should do the trick...
                  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
                  • 25663 MODX Staff
                  • 12,272 Posts
                  Actually, that almost works, but not quite.

                  Assume my comments folder is called Bulletein Board, and also is set to display all the comments.

                  It creates a document called Bulletein Board - User comments and stores all the comments there.

                  Now imagine that on a separate page, call it Another Page, you want to show the 2 most recent comments and you call as above. It creates another page called Another Page - User comments in the Bulletein Board folder.

                  I need to be able to specify which page exactly to display from... I think it has something to do with the tagid parameter, but I’m not sure how to hit upon the magic combo that works. (btw, I’m "turning off" the ability to make comments from this page by setting the &canpost=`noone`, as noone is a non-existant group in this situation)
                    Ryan Thrash, MODX Co-Founder
                    Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                    • 25663 MODX Staff
                    • 12,272 Posts
                    Hmmm...

                    After placing identical call parameters for &tagid and &folder, I think that something might be broken with the snippet. It didn’t work:

                    In the "remote display" calling page (id 93) called View:
                    [[UserComments? &folder=`190` &tagid=`BB` &recentposts=`2` &canpost=`no one`]]


                    In the "full view and add comments" main page/folder (id 190) called Post & View:
                    [[UserComments? &tagid=`BB` &folder=`190` &freeform=`1` &makefolder=`1` &formtpl=`BBPosts`]]


                    This results in two docs being created per the previous post:
                    View - User comments
                    Post & View - User comments
                      Ryan Thrash, MODX Co-Founder
                      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                      • 25663 MODX Staff
                      • 12,272 Posts
                      OK... fixed it. Had to add another parameter to the snippet... due in 0.9.1 or you can grab the file attached here.
                        Ryan Thrash, MODX Co-Founder
                        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me