Print If Set Conditionals
This page demonstrates Hashtag Print commands with If Set Conditionals.
A value containing only white-space will result in printing the else string.
Contexts can be applied to either string,
or to Variables within the strings.
Processing this Hashtag Markup:
<# print "<#[url.test as html]#>" if set else "No value set for <b>test</b> in the URL"; #>
No value set for
test in the URL
Processing this Hashtag Markup:
<# print "<#[url.test]#>" as html if set else "No value set for <b>test</b> in the URL"; #>
No value set for
test in the URL
Processing this Hashtag Markup:
<#
print "<#[url.test as html]#>" if set
else "No value set for <b>test</b> in the URL" as html;
#>
No value set for <b>test</b> in the URL