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
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."
I see. Does this mean snippets are no longer named as [[ snippet_name ]] ?
-Dorian
-
☆ 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.
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
[[snippet]] can be cached
[!snippet!] is uncached
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."