case
If you need more than one condition you can use the case Statement
{% case condition %}
{% when 1 %}
hit 1
{% when 2 %}
hit 2
{% else %}
elseblock
{% endcase %}
Example
{% case page.language_code %} {% when 'en' %} <p>This page is written in english</p> {% when 'et' %} <p>See lehekylg on eesti keeles</p> {% else %} <p> Don't know what the language is, really. It might be anything. Except english and estonian. </p> {% endcase %}
- Basics
- Variables
- Filters
- Components
- Localization
- Keyboard shortcuts
- Objects
- Article
- Asset
- Blog
- Comment
- Element
- Language
- Mediaset
- Menu item
- Page
- Person
- Site
- Tag
- Data
- Tags
- addbutton
- assign
- blogcontext
- case
- capture
- commentform
- content
- contentblock
- cycle
- editable
- elementscontext
- for
- grouped
- if
- ifchanged
- image
- include
- load
- login
- loginblock
- menuadd
- menubtn
- menulink
- reorder
- rss_link
- stylesheet_link
- unless
- xcontent
- Examples
- Creating a navigation menu
- Creating language selection
- Blog page example
- Blog article example
- Complete page example
- Breadcrumbs
- Standard theme definition
- Elements listing
- Element page
- Components