We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3763
    • 155 Posts
    If your document is uncached you have to use [[SnippetName]], if it’s cached use [!SnippetName!] and the snippet is executed on each page request.

    http://modxcms.com/adding-snippets.html
    Snippet tags can take two forms, [[SnippetName]] or [!SnippetName!].

    The first form is a normal snippet call; if the page is cached, the snippet’s output will also be cached. Usually this will not be a problem. Sometimes, however, it is important that the snippet’s output not be cached. For example, the Login snippet needs to determine if the user has logged in, and if not, display the login form, and if so, display the logout link. If the page is cached, the snippet is not run, and the display would not change. The second form, using exclamation marks, causes the snippet to be run even if the page has been cached. For a menu, however, that probably isn’t necessary.

    Boby
      ...my Photo Gallery on Flickr...
      • 25339
      • 6 Posts
      OK Thanks.. Now I understand better. I’ve uncached all documents and make the snippet calls by [[. With this, I’ve solved the duplicating problem of the comments.

      But does anybody know how to count the total comments of three different posts which I summarize in the homepage, without showing the comments of each one?

      [[Replix? &mode=`comments.count` &docid=`[+id+]`]] returns ever 0 comments.

        • 17883
        • 1,039 Posts
        @bs: There seems to be an issue with 0.95beta. On comment pages I get the following error(s):

        TinyButStrong Error in field [{post.name...}] : item ’name’ is not an existing key in the array. This message can be cancelled using parameter ’noerr’.

        TinyButStrong Error in field [{post.subject...}] : item ’subject’ is not an existing key in the array. This message can be cancelled using parameter ’noerr’.

        TinyButStrong Error in field [{post.message...}] : item ’message’ is not an existing key in the array. This message can be cancelled using parameter ’noerr’.

        These are the three fields of my comment form. Cancelling the message is no option since subject and message are not displayed (but they are stored in the XML).

        Replix call:

        [!Replix?customfields=`name,subject,message` &makefolder=`1` &captcha=`2` &sortorder=`0` &tplComment=`kommentar_tpl` &folder=`59` &tplForm=`kommentarform_tpl` &pagination=`10`  &customname=`name`!]


        XML after saving:

        −
        	<replix createdon="1158740575">
        −
        	<comment id="449527cb4e3afbdef05d59233c36db1a" createdon="1158740588" uid="" ip="127.0.0.1">
        <subject>tester</subject>
        <message>ewrer</message>
        <name>test</name>
        </comment>
        </replix>
        


        But on the page I only see the name of the poster, not the comment nor the message. With 0.92 it worked, so I don´t post the template chunks, but the error occurs also with the standard templates.
          • 28853
          • 34 Posts
          I get the snippet to work, sort of.. I can post comments in the form, and a XML is created, but then, all i get on the page is:

          #@#--TBS2--#@##@#--TBS1--#@#

          Where is my comment? wink

          Nevermind this, i got it to work smiley
            • 17883
            • 1,039 Posts
            I had this problem, too. Reason was a cached call. The snippet has to be called uncached imho.
              • 13993
              • 100 Posts
              @bs

              Are you still working on having the final release ready when 0.9.5 comes out of beta?
                • 7923
                • 4,213 Posts
                Yes, the successor will be included in 0.9.5.


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                  • 3763
                  • 155 Posts
                  Quote from: doze at Sep 24, 2006, 05:14 AM

                  Yes, the successor will be included in 0.9.5.
                  I think that’s the main reason/feature for me to upgrade to 0.9.5
                    ...my Photo Gallery on Flickr...
                    • 4195
                    • 398 Posts
                    It’s here! grin

                    Check http://modxcms.com/Jot-998.html .
                    Note that not all planned functionality is there yet but will be soon (still beta).
                      Armand Pondman
                      MODx Coding Team
                      :: Jot :: PHx
                      • 17802
                      • 190 Posts
                      Oooh looks good! Thanks! laugh I’ve been using UserComments but I’m going to experiment with Jot now. Do you recommend we use Jot instead of Replix?
                        Thanks for MODx - I love it!