From 0eb8d7a23d55913509f83ef527f390fcfff197b6 Mon Sep 17 00:00:00 2001
From: Colin Kuskie WebGUI has a powerful templating language built to give you maximum control over the layout of your content. NOTES:
+ message => q|
Both the template language and template variables are case-insensitive.
-
-In addition to any variables defined in a given template, the session variables are made available to you with this syntax:
+
- -<tmpl_var session.section.variable> - -
-In the examples below, please note that the words foo and bar are used as placeholders for the actual variable names that you'll use. They are not part of the template language. - - -VariablesSyntax: <tmpl_var foo> or <tmpl_var name="foo"> -
+ +Example: <tmpl_var name> -
+ -Conditions
+Conditions
To programmers conditions are nothing new, but to designers they can often be confusing at first. Conditions are really just true or false questions, and if you think of them that way, you'll have no trouble at all.
-
+Syntax: <tmpl_if foo> <tmpl_else> </tmpl_if>
Syntax: <tmpl_unless foo> <tmpl_else> </tmpl_unless>
-
Example: <tmpl_if isTrue> It was true!<tmpl_else> It was false! </tmpl_if> -
+Truth or falsehood is determined by the following rules:
All other variables are true.
Loops
Loops iterate over a list of data output for each pass in the loop. Loops are slightly more complicated to use than plain variables, but are considerably more powerful.
-
Syntax: <tmpl_loop foo> </tmpl_loop> -
+ -Example:
+Example:
+<tmpl_loop users>
+ Name: <tmpl_var first_name><br/>
</tmpl_loop>
-
+Loop Conditions
Loops come with special condition variables of their own. They are __FIRST__, __ODD__, __INNER__, and __LAST__.
-
+Examples:
<TMPL_LOOP FOO>
<TMPL_IF __FIRST__>
@@ -180,8 +180,56 @@ Loops come with special condition variables of their own. They are __FIRST__, __
</TMPL_LOOP>
-|,
- lastUpdated =>1106608811,
+|,
+ lastUpdated =>1130959765,
+ },
+
+ 'template variable title' => {
+ message => q|Template Variables|,
+ lastUpdated => 1130972019,
+ },
+
+ 'template variable body' => {
+ message => q|
+webgui.version
+The version of WebGUI on your site.
+
webgui.status
+The release status for this version of WebGUI, stable, beta, gamma, etc.
+
+Session Variables
+In addition to any variables defined in a given template, the session variables are made available to you with this syntax:
+
<tmpl_var session.section.variable>
+ +Some common, useful session variables are:
+ +session.var.adminOn
+This variable will be true if the user is in Admin mode.
+
session.var.userId
+The userId for the current user.
+
session.user.username
+The current user's username.
+
session.user.language
+The current user's preferred language (the default is English).
+
session.user.karma
+The user's karma.
+