<wmmeta name="Title" value="The <{set}> Directive" /> <wmmeta name="Section" value="03-proc_logic" /> <wmmeta name="Score" value="20" /> <wmmeta name="Abstract"> set a content chunk while inside another content chunk's scope </wmmeta> 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 small chunks of text, by including a <a href=$(set)><{set}></a> directive in the content item that uses them. For example, a common use of <{set}> is to define, ahead of time, what text should be inserted into a template: <{set template_body="&wmdollar;{foo.txt}"}> &wmdollar;{bar_template} Note: Order of Content Reference Processing ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The processing of content references starts at each <a href=$(out)><out></a> URL in turn, and descends from the chunk of text defined for that file, replacing each <a href=$(content_refs)>&wmdollar;{content_ref}</a> and <a href=$(url_refs)>&wmdollar;(url_ref)</a> one-by-one, in a depth-first manner. Finally, the tree-traversal starts again from the chunk of <out> text, searching for <a href=$(deferred_content_refs)>&wmdollar;[deferred_content refs]</a>. 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 <a href="$(deferred_content_refs)">&wmdollar;[deferred content ref]</a> 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" [wmmeta] to handle data that is associated with a content-item. Using <wmmeta> tags 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. [wmmeta]: $(wmmeta)