^if( condition )^

Tinderbox Icon

^if( condition )^

Test if the condition is true, then includes everything from the ^if statement to the ^else^ or the ^endif^. If the else/endif mark-up is omitted the text following the closing ) bracket of the condition is returned. These are functionally the same:

Whilst the usual way to test for the existence of an object or group remains


... the shorter test syntax


works as well — i.e. if a note has any descendants, then ^children^ is true.

Note there is no 'else if' branching syntax; for such tests nest if statements.

From v 3.0.0, the export element ^if^ now accepts agent query expressions in the condition. For example,


...is true if the note's title contains the string "tbx",


...is true if the note's title does not contain the string "tbx", and


...is true if the note's width exceeds 5.0

For the first two examples above the value matched can be an actual string or a regular expression (see more on this).

In the ^if^ condition, the agent query is always evaluated in the context of this note.

Also new from v3.0.0 is a slightly different if syntax: if(query){action list}else{action list}. This syntax can only be used internally in Actions and Rules. In such context, either if syntax may be used but the ^if version, with carets, is the only one that may be used in export templates.

Up: Export Codes - Full Listing
Previous: ^host^  Next: ^inboundBasicLinks( [start, list-item-prefix, list-item-suffix, end, type] )^ 

[Last updated: 3 Dec 2008]

Google search aTbRef for:  

Licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
[See aTbRef CC licence Attribution/Waiver info info]

Creative Commons License

Made with Tinderbox