<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>
WebMake: Documentation: The <{set}> Directive
</title>
<meta name="generator" content="WebMake/2.2" />
<style>
body {
background-color: #ffffff;
color: #000000;
font-size: medium;
font-family: verdana,lucida,helvetica,sans-serif;
}
code, samp, pre {
font-family: Courier New,courier,fixed-width,monospace;
}
H1 { font-size: x-large; font-family: Garamond,Book Antiqua,Times,serif; background: #FFCC66; }
H2 { font-size: large; font-family: Garamond,Book Antiqua,Times,serif; background: #FFDD77; }
H3 { font-size: medium; font-family: Garamond,Book Antiqua,Times,serif; background: #FFEE88; }
H4 { font-size: small; font-family: Garamond,Book Antiqua,Times,serif; }
H5 { font-size: x-small; font-family: Garamond,Book Antiqua,Times,serif; }
H6 { font-size: xx-small; font-family: Garamond,Book Antiqua,Times,serif; }
A:link {
font-weight: bold;
color: #004000;
text-decoration: underline;
}
A:visited {
font-weight: normal;
color: #008000;
text-decoration: underline;
}
A:active {
font-weight: bold;
color: #800000;
text-decoration: underline;
}
dt {
font-size: medium;
font-weight: bold;
padding-top: 8px; padding-bottom: 8px;
}
dd {
padding-top: 8px; padding-bottom: 8px;
}
</style>
</head>
<body bgcolor="#ffffff" text="#000000" link="#3300cc" vlink="#660066">
<font face="lucida,verdana,sans-serif">
<div align="center">
<img src="images/WebMakeTitle.png" alt="WebMake" width="500" height="122" />
</div>
<table width="100%">
<tr>
<td valign="top">
<strong><a href="http://webmake.taint.org/">WebMake</a>
Documentation</strong> (version 2.2)
</td>
<td valign="top">
<div align="right">
[ <a href="order.html">Back</a> | <a href="perl.html">Forward</a> | <a href="index.html">Index</a>
| <a href="allinone.html">All In One</a> ]
</div>
</td>
</tr>
</table>
<!-- yes, it's that Mozilla black-border code again ;) -->
<!-- stolen from www.mozilla.org via rc3.org -->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#aaaaaa">
<table border="0" cellspacing="4" cellpadding="4" width="100%">
<tr>
<td bgcolor="#ffffff">
<table border="0" cellspacing="4" cellpadding="4" width="100%">
<tr>
<td>
<h1>The <{set}> Directive</h1><p>
Small pieces of content can be set from within other content chunks or
<out> sections using the <set> directive. The format is
</p>
<blockquote>
<p>
<{set <em>name</em>="<em>value</em>"}>
</p>
</blockquote>
<p>
This can be useful to set small chunks of text, by including a <a href="set.html"><{set}></a> directive in the content item that uses them.
</p>
<p>
For example, a common use of <{set}> is to define, ahead of
time, what text should be inserted into a template:
</p>
<blockquote>
<p>
<{set template_body="${foo.txt}"}>
${bar_template}
</p>
</blockquote>
<a name="Note_Order_of_Content_Reference_Processing"><h3>Note: Order of Content Reference Processing</h3></a><p>
The processing of content references starts at each <a href="out.html"><out></a> URL in turn, and descends from the chunk of text
defined for that file, replacing each <a href="content_refs.html">${content_ref}</a> and <a href="url_refs.html">$(url_ref)</a> one-by-one, in a depth-first manner.
</p>
<p>
Finally, the tree-traversal starts again from the chunk of <out> text,
searching for <a href="deferred_content_refs.html">$[deferred_content
refs]</a>.
</p>
<p>
Therefore if you wish to <{set}> a variable, let's say <strong>x</strong>, in a chunk
of content that will not be loaded before <strong>x</strong> is accessed, you should use
a <a href="deferred_content_refs.html">$[deferred content ref]</a> to
access it.
</p>
<a name="How_lt_set_gt_Relates_To_Meta_data"><h3>How <{set}> Relates To Meta-data</h3></a><p>
The <{set}> directive was implemented before <a href="metadata.html">metadata</a> was, and initially
provided a way to do similar things, such as substitute page titles, etc.
</p>
<p>
Now, however, it's probably better to use <a href="wmmeta.html"><wmmeta> tags</a> 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.
</p>
<p>
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.
</p>
<p>
</p>
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%">
<tr>
<td valign="top">
<strong><a href="http://webmake.taint.org/">WebMake</a>
Documentation</strong> (version 2.2)
</td>
<td valign="top">
<div align="right">
[ <a href="order.html">Back</a> | <a href="perl.html">Forward</a> | <a href="index.html">Index</a>
| <a href="allinone.html">All In One</a> ]
</div>
</td>
</tr>
</table>
<div align="right">
<a href="http://webmake.taint.org/"> <img src="images/BuiltWithWebMake.png" alt="Built With WebMake" border="0" width="88" height="31" /></a>
</div>
</font>
</body>
</html>