We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • When MODx serves up a page, it is pulling together multiple components and
    executing multiple scripts to assemble the page into the final product that is
    displayed to the user. A MODx page can be composed of six different
    types of tags which are processed in the following order:

    [*content*] -- Template variables (built-in and custom)
    [(site_name)] -- Settings tags
    {{footer}} -- Chunk tags
    [[listIndexer?LIn_root=0]] -- Cached first, then uncached
    [~11~] -- Link tags
    [^t^] -- Timing tags

    The big questions on my mind are:
    1. Can someone check me on the order above?
    2. How does MODx handle looping (i.e. tags within tags)?

    The whacky experiment I tried was naming my site {{footer}}, then using [(site_name)] in a document. My "footer" chunk used the [(site_name)] tag, so it was parsed recursively 10 times.... that must be a built-in limit to prevent crashing, no? Is this the maxParserPasses value? Using a ’site_name’ of "[*longtitle*]" parsed correctly too, so I was tempted to think that the order above was not correct... until you bring up the possibility of multiple passes of the parser... I suppose for a really thorough test here, I’d have to set the maxParserPasses to 1.

    Can anyone put the tags in order? Or is the order somewhat unimportant because the parser takes multiple passes? The latter seems to be a viable explanation for the behavior I’m seeing. Can anyone explain nesting of tags (e.g. nesting Snippet calls... one Snippet provides an argument value for another Snippet). Does anyone have further resources for this fascinating yet elusive topic? Thanks!

    Two references:
    http://wiki.modxcms.com/index.php/Order_of_execution
    http://modxcms.com/modx-tags.html

    • Start poking around Susan’s articles for some great info: http://sottwell.com/how-modx-works.html
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me