<!--chtml date="
xxx"-->
Example:
<!--chtml date="%m/%d/%y"-->for this file would expand to:
6/20/08
<!--chtml date="
xxx" toponly-->
<!--chtml date="
xxx" allfiles-->
<!--chtml options date=toponly-->
toponly
unless it explicitly has allfiles
. Note all instances of this command in a file (and included files) are processed before any date commands, so given the code seqence:
<!--chtml date="%m/%d/%y"--> <!--chtml options date=toponly-->the date command will default to the toponly behavior.
<!--chtml options date=allfiles-->
allfiles
unless it explicitly has toponly
. The processing order caveat of the previous command also applies here.<!--chtml date="
xxx" file="
filename"-->
//webinfo/announce.html
which will search the current DOCUMENT_PATH
for the file. Note the order of the search is the reverse of how the http server searches for documents. In other words, on www.washington.edu, instead of searching in uw before world, chtml date statements will search world before uw.<!--chtml cmt-->
text<!--chtml /cmt-->
First sentence. <!--chtml cmt--> Second sentence. <!--chtml /cmt--> Third sentence.would expand as:
First sentence. Third sentence.
<!--chtml set
var="
value"-->
<!--chtml set
var-->
value<!--chtml /set-->
<!--chtml use
var-->
Examples of using variables:
<!--chtml set home="University of Washington Home Page"--> The <!--chtml use home--> was redesigned in June 1996.
would expand as:
The University of Washington Home Pagewas redesigned in June 1996.
An example of using the second form of setting variables:
<!--chtml set text-->complicated text which can include "quoted" material and many lines of text, as well as <B>HTML code</B>.<--chtml /set--> chtml can also set <!--chtml use text-->
would expand as:
chtml can also set complicated text which can include "quoted" material and many lines of text, as well as HTML code.
The contents of the variables will have no chtml processing done to them, so if you use the second form, you can have no chtml commands between the chtml set
and chtml /set
statements.
Some variables are predefined by chtml, and can be used either with the chtml use command or in conditional statements.
Variable Contents Example value (for this document) sourcefile Name of the file being used features.html sourcedir Name of the directory for this file /www/world/webinfo/chtml/ sourceuri Non-host part of the URL /webinfo/chtml/features.html servername Name of the server www.cac.washington.edu
<!--chtml include "
filename"-->
//webinfo/buttons.inc
which will search the current DOCUMENT_PATH
for the file. Note the order of the search is the reverse of how the http server searches for documents. In other words, on www.washington.edu, instead of searching in uw before world, chtml include statements will search world before uw.<!--chtml include "
filename" quoted-->
&
" becomes "&
", "<
" becomes "<
", and ">
" becomes ">
"). Useful if you wish to show the HTML markup of a file. Note that because of the quoting, you cannot use chtml commands in a quoted include file.<!--chtml if cond--> text <!--chtml elseif cond--> text <!--chtml else--> text <!--chtml endif-->
Will display text depending on conditions. Defined conditions are:
var="
xx"
any variable is equal to xx var=="
xx"
same as var="
xx"
var!="
xx"
any variable is not equal to xx var=~"
xx"
any variable matches the Perl regular expression xx var!~"
xx"
any variable does not match the Perl regular expression xx
<!--chtml anchor optargs-->
url<!--chtml /anchor-->
<A HREF="
url" optargs>
url</A>
For example:
<!--chtml anchor-->http://www.washington.edu/<!--chtml /anchor-->
would expand as: