Textpattern logo

Help?

if variable

From Textbook

<txp:if_variable>

The if_variable tag is a conditional tag and always used as an opening and closing pair, like this...

<txp:if_variable>
...conditional statements...
</txp:if_variable>

It tests the existence and/or value of a global variable set with the variable tag.

Contents

Attributes

Tag will accept the following attributes (case-sensitive):

name="variable name"
The name of the variable you wish to check.
value="value"
(optionally) the value which the named variable must match in order for the contained statements to be executed. If this attribute is omitted, the tag returns true if the named variable contains any value at all (i.e. it is not empty, or is defined).

Examples

See the variable page for examples.

Genealogy

Version 4.0.7

  • Added as a new tag.

Translations [?]...

About Textbook