diff --git a/lib/WebGUI/Help/Asset_Template.pm b/lib/WebGUI/Help/Asset_Template.pm index 94eb85138..d7e19b36e 100644 --- a/lib/WebGUI/Help/Asset_Template.pm +++ b/lib/WebGUI/Help/Asset_Template.pm @@ -19,7 +19,11 @@ our $HELP = { { tag => 'template language', namespace => 'Asset_Template' - } + }, + { + tag => 'template variables', + namespace => 'Asset_Template' + }, ] }, 'template add/edit' => { @@ -68,6 +72,23 @@ our $HELP = { body => '826', fields => [ ], + related => [ + { + tag => 'templates manage', + namespace => 'Asset_Template' + }, + { + tag => 'template variables', + namespace => 'Asset_Template' + }, + ] + }, + + 'template variables' => { + title => 'template variable title', + body => 'template variable body', + fields => [ + ], related => [ { tag => 'templates manage', diff --git a/lib/WebGUI/i18n/English/Asset_Template.pm b/lib/WebGUI/i18n/English/Asset_Template.pm index 9487aa1f9..18c353e6b 100644 --- a/lib/WebGUI/i18n/English/Asset_Template.pm +++ b/lib/WebGUI/i18n/English/Asset_Template.pm @@ -93,41 +93,37 @@ Give this template a descriptive name so that you'll know what it is when you're }, '826' => { - message => q|WebGUI has a powerful templating language built to give you maximum control over the layout of your content. -
NOTES:WebGUI has a powerful templating language built to give you maximum control over the layout of your content.
+NOTES:
Both the template language and template variables are case-insensitive.
-
- -<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.
+