WebMake Documentation (version 1.1)

The <{set}> Directive

Small pieces of content can be set from within other content chunks or <out> sections using the <set> directive. The format is

<{set name="value"}>

This can be useful to set headlines or titles, by including a <{set}> directive in their text.

In addition, to insert some text into a template, set the text as variables beforehand:

<{set body="${foo.txt}"}> ${bar_template}

Note: Order of Content Reference Processing

The processing of content references starts at each <out> URL in turn, and descends from the chunk of text defined for that file, replacing each ${content_ref} and $(url_ref) one-by-one, in a depth-first manner.

Finally, the tree-traversal starts again from the chunk of <out> text, searching for $[deferred_content refs].

Therefore if you wish to <{set}> a variable, let's say x, in a chunk of content that will not be loaded before x is accessed, you should use a $[deferred content ref] to access it.

How <{set}> Relates To Meta-data

The <{set}> directive was implemented before metadata was, and initially provided a way to do similar things, such as substitute page titles, etc.

Now, however, it's probably better to use <wmmeta> tags to do that kind of content-item metadata, as it means your pages will be able to take advantage of new features, like index and site-map generation.

The <{set}> directive is retained as a way of quickly setting content items from within other content, in case this feature proves useful for other purposes.

WebMake Documentation (version 1.1)