if…(else…)endif
match this…with…that
[if,type=match,this=,that=]
match code
[endif]
[if,type=match,this=,that=]
match code
[else]
nomatch code
[endif]
this is
blank[if,this=,type=blank]
blank code
[else]
notblank code
[endif]
this is
not blank[if,this=,type=notblank]
notblank code
[else]
blank code
[endif]
today is
before this
[if,this=dd/mm/yy,type=before]
before code
[else]
not before code
[endif]
this is
today[if,this=dd/mm/yy,type=today]
today code
[else]
not today code
[endif]
today is
after this
[if,this=dd/mm/yy,type=after]
after code
[else]
not after code
[endif]
today is
between this and that (inclusive)
[if,type=between,this=dd/mm/yy,that=dd/mm/yy]
between code
[else]
outwith code
[endif]
Parameters
type is match - match "this" with "that" resulting in "match" or "nomatch"
type is blank - match "this" with "" resulting in "blank" or "notblank"
type is notblank - match "this" with "" resulting in "notblank" or "blank"
type is before - today is before "this" resulting in "match" or "nomatch"
type is after - today is after "this" resulting in "match" or "nomatch"
type is today - today is "this" resulting in "match" or "nomatch"
type is between - today is "this" or after and today is "that" or before resulting in "match" or "nomatch"
type is inbetween - today is after "this" and today is before "that" resulting in "match" or "nomatch"
this - string or date to match
that - string or date to match with "this"
match - return if "this" matches "that"
nomatch - return if "this" does not match "that"
Examples
Example#1 if "y" and display "Yes" or "No"
y = [include,answer,y]
x = [include,answer,x]
content/answer:
[if,type=match,this=[parmeter,1],that=y]
Yes
[else]
No
[endif]
Output:
y = Yes
x = No
Example#2 include content if datafield is not blank
[includekeys,price,title=Product A,now=9.99,was=19.99]
[includekeys,price,title=Product B,now=5.99]
content/price:
[datafield,title] is [datafield,now]
[if,type=notblank,this=[parmeter,1]]
[include,[datafield,was]]
[endif]
content/previous:
was [textstyle,font-style:bold;color:#ff0000;][parameter,1][textstyleend]
Output:
Product A is 9.99 was 19.99
Product B is 5.99
Example#3 display Opening Soon until 17/9/24 and then display Now Open
[if,type=before,this=17/9/24]
Opening Soon
[else]
Now Open
[endif]
Output:
Now Open
Example#4 display Sale Finished after 17/9/24 otherwise display Sale On
[if,type=after,this=17/9/24]
Sale Finished
[else]
Sale On
[endif]
Output:
Sale Finished
Example#5 display Sale ON from 1/8/25 to 14/8/25
[if,type=between,this=1/8/25,that=14/8/25]
Sale On
[endif]
Output:
Example#6 display Sale ON after 31/7/25 and before 15/8/25
[if,type=inbetween,this=31/7/25,that=15/8/25]
Sale On
[endif]
Output:
Notes
[else]… is optional
[ifend] can be used instead of [endif]