If Conditionals
Learn the fundamentals on how to write if statements in Parsley.
Parsley provides {{if}}
conditional statements for logic flow.
Checking Equality
When writing if conditionals you can check equality with a single equals character; ==
. Equality can also be inverted with a bang; !=
.
If you're evaluating another Parsley expression including autogenerated fields inside of an if conditional use single curly brackets to wrap your expression. If you are expecting this variable to be a string (this includes ZUIDs) be sure to wrap it in quotes.
If / Else
When writing an if conditional you can also specify an else condition.
If / Else If / Else
You may have multiple conditionals using else if
Connect with Content Experts
Book a free 15-minute consultation with a content expert. Discuss your application, pain points and requirements. Understand how Zesty's lower total cost of ownership, features, functionality can elevate your business by creating extraordinary digital experiences.
Trusted By
G2 MOMENTUM LEADER