Class | Liquid::If |
In: |
lib/liquid/tags/if.rb
|
Parent: | Block |
If is the conditional block
{% if user.admin %} Admin user! {% else %} Not admin user {% endif %} There are {% if count < 5 %} less {% else %} more {% endif %} items than you need.
SyntaxHelp | = | "Syntax Error in tag 'if' - Valid syntax: if [expression]" |
Syntax | = | /(#{QuotedFragment})\s*([=!<>a-z_]+)?\s*(#{QuotedFragment})?/o |
ExpressionsAndOperators | = | /(?:\b(?:\s?and\s?|\s?or\s?)\b|(?:\s*(?!\b(?:\s?and\s?|\s?or\s?)\b)(?:#{QuotedFragment}|\S+)\s*)+)/o |
BOOLEAN_OPERATORS | = | %w(and or) |