We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26435
    • 1,193 Posts
    I can not get user comments to accept my &displaytpl=`chunkname` as a template for comments layoyt. I went in to the snippet and changed the default in there, and it still displayse the same way. I even deleted this whole section of the snippet:
    if(empty($displaytpl)) $displayTpl = '
    [+UID:[+uid+]+]<div[+postclass+]>
       <div[+numberclass+]>
         [+postnumber+]
       </div>
    	<div[+titleclass+]>
    		<strong>[+subject+]</strong><span>[+user+] [+createdon+]</span>
    	</div>
    	<div class="content">
    		[+comment+]
    	</div>
    
    </div>
    ';
    

    and it still display’s the same "default" layout for comments. cacheable is set to "off" on all the articles with comments, and the snippet is called with [!SnippetName!], so I don’t know what is happening?

    any insights?

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


      I send pointless little messages
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      browser cache? are you sure you’re working on the correct files? (I once spent hours fighting a css issue, only to finally realize I was connected to the wrong website...I won’t say what happened to the poor site I was actually connected to!) From looking at the source for the snippet, I don’t see how that can happen "normally".
        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
        • 32241
        • 1,495 Posts
        You might wanna use [!snippet_name!] instead of [[snippet_name]], and make sure that you refresh your site/clear your site cache.

        Hope that helps...


        Sincerely,
        Wendy Novianto
          Wendy Novianto
          [font=Verdana]PT DJAMOER Technology Media
          [font=Verdana]Xituz Media
          • 18397
          • 3,250 Posts
          IMPORTANT: The snippet writes each comment sequentially in a document using your template. Once a comment has been created changing its template will do nothing except affect new comments. You must remove the old comments or create a new comment to see the effects of your template.
            • 25663 MODX Staff
            • 12,272 Posts
            LOL... good point Mark. I’ll bet that’s what’s going on!
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 18397
              • 3,250 Posts
              I’m sure of that because I had this same problem a while back and I ended up going line by line through the snippet code to figure things out.
                • 26435
                • 1,193 Posts
                Aha! super, thanks Susan, Mark, Ryan, et all!

                Do you think editing the document that comments are written to will work?
                Why am I asking this question?
                I am going to try it anyway.

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


                  I send pointless little messages
                  • 26435
                  • 1,193 Posts
                  Just in case anyone else asks....
                  I edited the content of the page that holds the blog comments for one of my blogs, and I was able to change the layout.

                  But I see what you are saying Mark... It writes the entire template to the document. Perhaps in a later revision, it will be possible to have just text and tags written to the doc, and let the snippet parse template info each time it is called?

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


                    I send pointless little messages