We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13442
    • 4 Posts
    Can someone tell me the difference between enclosing a snippet between [[...]] and [!...!]?

    I wanted to include a snippet with a simple form in a page. I put it in the Document Content using the [[mysnippet]] method. The form was printed perfectly, it worked when I clicked the ’Submit’ button, all the form parameters were printed on the subsequent URL (I was using method=’get’), but the $_GET array didn’t have any of the parameters. Neither did the $_REQUEST array.

    This made processing the form a bit difficult. I struggled with this for an hour, then finally thought to try the [!mysnippet!] method. This solved the problem. Now I’m wondering why. What is the difference between these two methods???

    Thanks: John
      • 18397
      • 3,250 Posts
      [[ is cached

      [! is uncached

      You can’t cache something dyamic (like a form) so you use the [! when you need interaction.
      • Also keep in mind, that this only has an effect if the page is marked as cacheable. And, even then, depending on what the snippet is trying to do, it may not behave properly if called uncached (i.e. [!uncachedSnippet!]) on a cached page. Some examples might be snippets that attempt to modify the documentObject, access dynamic TV data from other pages, rely on dynamic TV data that is cached with the page, etc. But in general, you can cache the pages and pick and choose which snippets not to cache; then only that portion of the page will be re-evaluated.
          • 13442
          • 4 Posts
          That makes sense. Thanks!