We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7869
    • 118 Posts
    What kind of a variable is it? It’s part of the default template, but the documentation on MODx Tags does not clarify what this type of tag is nor how to use it.
      -Dorian
      • 7923
      • 4,213 Posts
      It’s a snippet. Look in the snippet tabs in modx resources. There is a snippet called DropMenu (unless you are using beta releases, dropmenu is deprecated and been replaced by Wayfinder). Snippets are just php code that return the string that is then put on to the page where the snippet is called.


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 7869
        • 118 Posts
        I see. Does this mean snippets are no longer named as [[ snippet_name ]] ?
          -Dorian
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          A snippet can be named whatever you want to name it. As long as you call it with the exact same name in the tags.
            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
            • 7869
            • 118 Posts
            Okay, I’m curious though. Why does the documentation show a snippet as [[ MySnippet ]] but then the default data files from the MODx install show them as [! MySnippet !] ? Do you see the confusion? One uses double brackets; the other uses bracketed exclamations. Does this interchangeability apply to TVs, Chunks, Settings, Timings, Links, and Placeholders as well?
              -Dorian
              • 33033
              • 43 Posts
              [[snippet]] can be cached
              [!snippet!] is uncached
                • 7923
                • 4,213 Posts
                calling snippet [[..]] runs it cached, calling using [!..!] runs it uncached. Read the documentation page about document caching to understand what it means.


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."