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.

Methods

new   render   unknown_tag  

Constants

SyntaxHelp = "Syntax Error in tag 'if' - Valid syntax: if [expression]"
Syntax = /(#{QuotedFragment})\s*([=!<>a-z_]+)?\s*(#{QuotedFragment})?/
ExpressionsAndOperators = /(?:\b(?:\s?and\s?|\s?or\s?)\b|(?:\s*(?!\b(?:\s?and\s?|\s?or\s?)\b)(?:#{QuotedFragment}|\S+)\s*)+)/

Public Class methods

Public Instance methods

[Validate]