A.1. Standard Parsing

Under normal circumstances, the template page containing tags and HTML is parsed in the following order:

  1. Any content in MV_AUTOLOAD is prepended to the template page.

  2. Any [pragma] tags anywhere in the text are processed, and the specified pragmas are set.
    • Since [pragma] tags are preprocessed before any other content, reparse will not catch them, nor will they work if included in variables. Also, the specified pragma will apply to the entire template (not just the section after the tag).
    • If you want to apply a pragma with a variable or only to part of a document, you must use [tag pragma="..."] instead.

  3. Variables (macros) are processed in the following order:
    1. @@VARNAME@@ global variables
    2. @_VARNAME_@ local or global variables
    3. __VARNAME__ local variables

  4. Interchange comments are stripped.

  5. False-endtag macros are expanded (e.g., [/page] and [/order]).

  6. '<!--[tagname]-->' escapes are converted to [tagname]
    • This can be a convenience for your HTML editor if it has trouble with tags using the standard [tagname] syntax.
    • However, if you want to HTML-comment out an Interchange tag in content that will be fed raw to a browser, you must include whitespace between the HTML comment delimiters and the tag, like this, '<!--  [tagname]  -->'.

  7. The main tag parser is called.
    • Some tags parse recursively (depending upon reparse and interpolate settings, of course).
    • Some tags (e.g., [loop]) process PREFIX-tags in their contained body text. Hence, the PREFIX-tags are not handled recursively.
    • Some tags are interpreted in the lib/Vend/Parse.pm:start routine. You cannot call them with the '$Tag->tagname()' syntax. They are:
      • The [goto] tag. Note also that the [goto] tag handles the [label] tag.

  8. Image paths substitution on the HTML output occurs.