202 lines
3.0 KiB
Plaintext
202 lines
3.0 KiB
Plaintext
==================
|
|
Ifchanged Basic
|
|
==================
|
|
|
|
{% ifchanged %}
|
|
content
|
|
{% endifchanged %}
|
|
|
|
---
|
|
|
|
(template
|
|
(content)
|
|
(ifchanged_group
|
|
(ifchanged_clause
|
|
(ifchanged_block)
|
|
(template
|
|
(content)))
|
|
(endifchanged_block))
|
|
(content))
|
|
|
|
==================
|
|
Ifchanged With Values
|
|
==================
|
|
|
|
{% ifchanged var1 var2 %}
|
|
content
|
|
{% endifchanged %}
|
|
|
|
---
|
|
|
|
(template
|
|
(content)
|
|
(ifchanged_group
|
|
(ifchanged_clause
|
|
(ifchanged_block
|
|
(filtered_value
|
|
(value
|
|
(variable_attribute
|
|
(identifier))))
|
|
(filtered_value
|
|
(value
|
|
(variable_attribute
|
|
(identifier)))))
|
|
(template
|
|
(content)))
|
|
(endifchanged_block))
|
|
(content))
|
|
|
|
==================
|
|
Ifchanged With Else
|
|
==================
|
|
|
|
{% ifchanged %}
|
|
content
|
|
{% else %}
|
|
unchanged
|
|
{% endifchanged %}
|
|
|
|
---
|
|
|
|
(template
|
|
(content)
|
|
(ifchanged_group
|
|
(ifchanged_clause
|
|
(ifchanged_block)
|
|
(template
|
|
(content)))
|
|
(else_clause
|
|
(else_block)
|
|
(template
|
|
(content)))
|
|
(endifchanged_block))
|
|
(content))
|
|
|
|
==================
|
|
Ifchanged With Values And Else
|
|
==================
|
|
|
|
{% ifchanged x y|upper %}
|
|
content
|
|
{% else %}
|
|
unchanged
|
|
{% endifchanged %}
|
|
|
|
---
|
|
|
|
(template
|
|
(content)
|
|
(ifchanged_group
|
|
(ifchanged_clause
|
|
(ifchanged_block
|
|
(filtered_value
|
|
(value
|
|
(variable_attribute
|
|
(identifier))))
|
|
(filtered_value
|
|
(value
|
|
(variable_attribute
|
|
(identifier)))
|
|
(filter_expression
|
|
(filter))))
|
|
(template
|
|
(content)))
|
|
(else_clause
|
|
(else_block)
|
|
(template
|
|
(content)))
|
|
(endifchanged_block))
|
|
(content))
|
|
|
|
==================
|
|
Ifchanged With An Empty Else
|
|
==================
|
|
|
|
{% ifchanged %}
|
|
content
|
|
{% else %}{% endifchanged %}
|
|
|
|
---
|
|
|
|
(template
|
|
(content)
|
|
(ifchanged_group
|
|
(ifchanged_clause
|
|
(ifchanged_block)
|
|
(template
|
|
(content)))
|
|
(else_clause
|
|
(else_block))
|
|
(endifchanged_block))
|
|
(content))
|
|
|
|
==================
|
|
Ifchanged Nested In The Else Of Another
|
|
==================
|
|
|
|
{% ifchanged %}
|
|
a
|
|
{% else %}
|
|
{% ifchanged %}
|
|
b
|
|
{% else %}
|
|
c
|
|
{% endifchanged %}
|
|
{% endifchanged %}
|
|
|
|
---
|
|
|
|
(template
|
|
(content)
|
|
(ifchanged_group
|
|
(ifchanged_clause
|
|
(ifchanged_block)
|
|
(template
|
|
(content)))
|
|
(else_clause
|
|
(else_block)
|
|
(template
|
|
(content)
|
|
(ifchanged_group
|
|
(ifchanged_clause
|
|
(ifchanged_block)
|
|
(template
|
|
(content)))
|
|
(else_clause
|
|
(else_block)
|
|
(template
|
|
(content)))
|
|
(endifchanged_block))
|
|
(content)))
|
|
(endifchanged_block))
|
|
(content))
|
|
|
|
==================
|
|
Ifchanged With Two Elses
|
|
:error
|
|
==================
|
|
|
|
{% ifchanged %}
|
|
a
|
|
{% else %}
|
|
b
|
|
{% else %}
|
|
c
|
|
{% endifchanged %}
|
|
|
|
---
|
|
|
|
|
|
==================
|
|
Ifchanged With An Argument On Else
|
|
:error
|
|
==================
|
|
|
|
{% ifchanged %}
|
|
a
|
|
{% else x %}
|
|
b
|
|
{% endifchanged %}
|
|
|
|
---
|