We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2136
    • 134 Posts
    i’ll have to figure that out. is there someplace where i can get all the snippet back to return the styling info? then i’d be able to tell if the alternate chunk action would be working.
      Sorry - not using ModX anymore 01/01/2007
      • 7923
      • 4,213 Posts
      I’m not sure I understand what you are saying, but what Ryan means is that you should use the &displaytpl parameter in the snippet call to define your own template (chunk) what will be used to show/format the comments. Look for more information at UserComments documentation. Also these tutorials could be usefull for you.


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 2136
        • 134 Posts
        it’s definitely newbie growing pains. i have been following the tutorial (haven’t moved on to registering users yet ), and i have used the &displaytpl parameter, using the default template and modifying it:

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

        however, even by setting every &___css parameter for UserComments, the default styles seemed to override my classes. and with the default display template, this bit of unvalidating joy appeared: <div style=</div></div>, which is what really threw me off.

        i’m ok with hacking all the default styles out of it, though i wouldn’t mind having them to play with (i ditched them in a fit). but i am curious about how to make the dates for the comments match the date style (using [+date+] blows the styling on my home page, shoving my sidebar down). and also why clicking the links on the home page for the comments (at http://tinygrass.com/home.html, either the New Link Page - User Comments or Read More goes to a page that displays the text ’[*content*]’ and nothing else). the tutorial is pretty good, but seems aimed at someone a bit more knowledgable than me, so i’m sure that i’m missing stuff here and there.
          Sorry - not using ModX anymore 01/01/2007
          • 7923
          • 4,213 Posts
          Quote from: arphaus at Jul 20, 2006, 10:45 PM

          however, even by setting every &___css parameter for UserComments, the default styles seemed to override my classes.
          That shouldn’t happen.. every css class you define your self should override the default styles.. &postcss also uses &altrowcss and &authorcss. Are you calling the snippet uncached (i.e. using [!UserComments!]) or are the whole documents uncached?

          Quote from: arphaus at Jul 20, 2006, 10:45 PM

          but i am curious about how to make the dates for the comments match the date style (using [+date+] blows the styling on my home page, shoving my sidebar down).
          You can use the &dateformat parameter to define the format to use in dates. See http://php.net/strftime for formatting options.

          Quote from: arphaus at Jul 20, 2006, 10:45 PM

          and also why clicking the links on the home page for the comments (at http://tinygrass.com/home.html, either the New Link Page - User Comments or Read More goes to a page that displays the text ’[*content*]’ and nothing else).
          is the template on that document ok? also, if you copy paste the tags from documentation to the RTE, make sure that the calls are what they seem by looking at the source (click source button from RTE, or disable RTE)


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 2136
            • 134 Posts
            ok - i’m unclear on what difference it makes for somethng to be cached or uncached. i don’t thnk i saw mention of it in the blog tutorial, but i may have missed it. i’m waiting on a php book from the library so that i’ll be more up to speed, but i’ll look for some tutorials on line to get started. i’m on vacation for the next few days, so i’ll let this stuff be and enjoy the beach laugh
              Sorry - not using ModX anymore 01/01/2007
              • 7923
              • 4,213 Posts
              When you create a document, you can set it cacheable or not cacheable in the "Page Settings" tab. If you set the document to be cacheable it means that the document and it’s content will be parsed only at the first request of the document, i.e. the snippets are run and their output is put to page content etc. Then the parsing result is "saved" to the cache and retrieved from there on in any following requests. It can speed up the page loads when the document is not parsed on every request, loads just like a static .html file.

              So test this: if you create a document and set it to be cacheable, then save the document and visit the page first time, it will prosess it and save to cache. Then if you go an edit the page again, and in the page settings uncheck "Empty cache" and save it, and now visit the document, it will still show the old content, because it’s being retrieved from cache instead of parsing it every time. Now if you go and clear your site cache by doing Site > Refresh site in the MODx manager and visit the page, you will see the new content, because the page is now parsed again at the first visit and saved back to cache.

              Now when you have some dynamic content on the page, i.e. snippets and you call them using [[Snippet]], they will too be cached. They’ll run only at the first request and after that, its all coming from cache. If you change some parameters on your cached snippet call on a cached document, you might not see the changes because it’s not parsed on every request. But you can force the snippet to run on every request even if the document itself is cached by using [!Snippet!] call (note the ! chars). Then your snippet will be parsed on every visit to the page. Or you could set the whole page to be uncached at the "Page settings" tab (uncheck cacheable). Then it doesn’t matter if the snippet calls are [[cached]], because the whole document will be parsed on every request anyways.

              When you’re building your site, I’d suggest to set in the system configuration that document’s will not be cacheable by default. It can help you get over these things when you wonder why something doesn’t work like it should. Then after your site is starting to be done, you can set the more static pages to be cacheable, so they’ll load a little bit faster. Then when you edit some of these cacheable documents, allways do a site refresh. Or be sure to just use uncached snippet calls allways i.e. [!snippet!] when the snippet outputs dynamic content.

              I hope you understand the caching litte better now, feel free to ask more if you need. And have a happy vacation!! grin


                "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                • 2136
                • 134 Posts
                thanks very much for a great explanation, and the general helpfulness too!
                  Sorry - not using ModX anymore 01/01/2007
                  • 2136
                  • 134 Posts
                  i’m back & nicely refreshed laugh the caching did the trick, and i set the default so that the pages are not cached. this makes a lot more sense, and getting away for a couple of days didn’t hurt either. nothing like some sun & surf to clear the mind. thank you!
                    Sorry - not using ModX anymore 01/01/2007