macro
(directive in module tri
)
Used to provide HTML manipulation and insertion. Used for tempolates and to disable sections of code.
The raw HTML passes through a modification cycle where the alter and other standard $word$ strings are
replaced with new values just before the final insertion.
Note that the new HTML can itself contain macro directives. That is, the macro directive is recursive.
The value <img-defer ...> are replaced by <img ...>. This defers the loading
of the images until the template is actually used. It also defers loading until the template is positioned under the correct
base URL. Refer to Template Load Process
The alter param consists of a repeated group of pairs.
Refer to tri.applyAlters for the format.
<macro fetch='template-name.html' alter='fromstr/tostr;....' col='' mode='' marker='' obj='' objref=''></macro>
alter – {string} –
Alters the raw HTML string before insertion using RegExp patterns. Refer to tri.applyAlters for the format.
col – {string} –
Used internally in conjuction with the mode parameter to generate standard HTML chunks. Also used
to extract the field name of the column. The $MODEL$ will be replaced by this field name.
fetch – {string} –
Template name to fetch. If not specified the col and mode params are
used to manufacture a standard block of HTML to insert.
marker – {string} –
used to create HTML comments in the generated code containing the marker string for diagnostic purposes.
mode – {string} –
Used internally in conjuction with the mode parameter to generate standard HTML chunks.
obj – {string} –
The string $MODOBJ$ will be replaced by this value known as sObj.
objref – {string} –
The object reference sObj is set by evaluation of the objref string.