We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8230
    • 2 Posts
    I am using the standard snippets to sign up a user and and webblogin snippet but both dont work. I called them how the instructions stated for me to call them and they show up but when a create a test user nothing happens.

    is there something else i have to modify.

    I am very new to this content management system and any help is gratly appreciaed

    • Did you call them uncached?
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 8230
        • 2 Posts
        i went in and under page settings i unchecked the box that states cacheable
          • 4295
          • 98 Posts
          Durangio, I think Ryan meant the snippet call itself, not if the page was cached or uncached. To better understand, go here http://modxcms.com/adding-snippets.html in the documentation and page down to "Configuring Snippet Tags."

          Excerpt: "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."
            • 7923
            • 4,213 Posts
            Read partial document caching documentation page to understand how the caching works.


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 10746
              • 126 Posts
              Quote from: doze at Oct 25, 2006, 09:28 PM

              Read partial document caching documentation page to understand how the caching works.

              If have read this page several times, and it is still not entirely clear to me... let me see if I have it correct

              Situation 1: Page cached, snippet cached
              - page constructed on first request, then entire page including snippet output cached and delivered unchanged on subsequent requests (if still in cache).

              Situation 2: Page cached, snippet uncached
              - page constructed on first request, then ENTIRE page regenerated on subsequent requests due to need to insert new snippet output. (Is this true? does a single uncached snippet cause ALL other snippets on same page to be re-run or is the output cached on a "per-snippet" basis?)

              Situation 3: Page uncached, snippet EITHER
              - page regenerated on EVERY request, regardless of parameters of any contained-snippets.

              (In paticular, the OP durangio should have achieved his or her goal by unchecking page-caching.)

              Thx

              Gordon
              • Quote from: gfroyle at Nov 19, 2006, 12:57 AM

                Situation 2: Page cached, snippet uncached
                - page constructed on first request, then ENTIRE page regenerated on subsequent requests due to need to insert new snippet output. (Is this true? does a single uncached snippet cause ALL other snippets on same page to be re-run or is the output cached on a "per-snippet" basis?)
                You’ve almost got it, except the entire page is not regenerated; only the uncached snippets are parsed after a cached page’s content is loaded. In other words, the content which is cached does not include the results of uncached snippet tags [! !]; they get left in the cached content so they are re-parsed on each hit.
                  • 10746
                  • 126 Posts
                  Quote from: OpenGeek at Nov 19, 2006, 01:29 AM

                  You’ve almost got it, except the entire page is not regenerated; only the uncached snippets are parsed after a cached page’s content is loaded. In other words, the content which is cached does not include the results of uncached snippet tags [! !]; they get left in the cached content so they are re-parsed on each hit.

                  Aha... light goes on!!

                  So a cached copy of a page contains the literal text output of all the static HTML + cached snippets but keeps the snippet *CALL* for the uncached ones, so that when it is re-parsed, these snippets get executed once again... so basically the parser is presented with a "half-baked" page just to finish off...

                  And if a page is uncached, then nothing is saved, so the whole thing has to be re-generated regardless of how its snippets were called...

                  Just out of interest, if a page has NO uncached snippets, then is this fact "remembered" when it is first generated so that subsequent requests can literally serve the identical HTML without even *reading* it to see if there are any uncached snippets needing to be run...

                  Cheers

                  gordon

                  • The main parser is only run in two cases: if the document is not cached, and if the cached document turns out to have uncached snippet tags.

                    As far as I can see, all documents always get checked for uncached snippets.

                    The outputContent() function first checks for uncached snippets, sending the document to the parseDocumentSource function if there are (and gets it back again when that function is finished).

                    Then it inserts any requested javascript or CSS tags into the document. (regClientStartupScript and friends)

                    Then it removes any unused placeholder tags [+...+].

                    Then it rewrites URLs.

                    Then it calculates the time and number of queries and sets up the variables for that display.

                    Then it sets up the various HTTP and HTML headers necessary.

                    Then it replaces the [^...^] tags with the timing, number of queries, whether from cache or not.

                    Then it invokes the onWebPagePrerender event.

                    Then it echoes the documentOutput.

                      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