ComicCMS User Manual

HomeDownloadManualForums

Template Structures :: If Operators

Thought you'd escaped operators by now? Afraid not, they have more uses than you may think.

Just checking if variable is all well and good, but things get much more interesting if we can compare the variable to other things. Like if variable is less than 1. Applying special operators to the end of an if statement can give you this power, e.g. {{if:comic_ext:=swf}}

OperatorOutcome
{{if:*:=foo}}True if the variable is foo or Foo or fOO (case insensitive)
{{if:*:==foo}}True only if the variable is foo (case sensitive)
{{if:*:!}}Flips the if statement around. True if variable is false and false if variable is true
{{if:*:>4}}True if the variable is greater than 4
{{if:*:>=4}}True if the variable is greater than or equal to 4
{{if:*:<4}}True if the variable is less than 4
{{if:*:<=4}}True if the variable is less than or equal to 4

ComicCMS, free php webcomic management software Copyright © 2007 Steve H