>code to be processed if condition matches
>(optional) code to be processed if alternative condition matches; this can occur multiple times
<$else>(optional) code to be processed if none of the previous conditions matched
<$elseif> require a boolean attribute
false is represented by an empty string,
true by any non-empty string. Normally, you will like to
<$if COND=(NAME="sepp")> You must be sepp! </$if>
This one inserts the text "
You must be sepp!", if the attribute
NAME has the value "
sepp". Note that the
="-operator performs a case-insensitive string-comparison,
NAME="SEPP" would lead to the same result.
<$if COND=(NAME="sepp")> You must be sepp! <$else> I don't know you. </$if>
NAME="sepp" will create the same text as above. Any
other value for
NAME will insert
I don't know you.".
Nesting them is also possible, of course:
<$if COND=(NAME="sepp")> You must be sepp! <$if COND=(HOME="austria")> Hollareiduliö! An Austrian! <$else> <(HOME)>? Never been there. </$if> <$else> A strange guy from a strange place. </$if>
You should not compare hsc's
<$if> with the primitive and
#if of the C-preprocessor. The main difference is
that you can use
<$if> inside macros and that expressions are
recalculated for every new call of the macro.
<$macro TRY-A HREF:uri/r TITLE:string/r> <$if COND=(Exists(HREF))> <a HREF=(HREF)><(TITLE)></a> <* insert link to HREF *> <$else> <(TITLE)> <* insert plain title *> </$if> </$macro>
This macro inserts a link to an URI specified with
TITLE as link text; but only, if the destination
(local) URI can be accessed. If the required document is not
available, only the plain text without a link will be inserted.
/r" behind the declaration of the
macro-attributes is short for "
/required" and means that
the macro needs both of these attributes to be set during the
For example, you can utilize this macro using
You should read the document about recent <try-a HREF="../bugfixes.html" TITLE="bufixes"> if there are any.
This leads to the text
You should read the document about recent bugfixes if there are any.
with a anchor around the term "
bugfixes" if the document