mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-19 19:00:39 -07:00
Clarify a not-null example. Fixes #247
+7
-15
@@ -120,6 +120,13 @@ optionally, `elsif` and `else`) clause:
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
# Same as above
|
||||||
|
{% if user != null %}
|
||||||
|
Hello {{ user.name }}
|
||||||
|
{% endif %}
|
||||||
|
```
|
||||||
|
|
||||||
```liquid
|
```liquid
|
||||||
{% if user.name == 'tobi' %}
|
{% if user.name == 'tobi' %}
|
||||||
Hello tobi
|
Hello tobi
|
||||||
@@ -153,20 +160,6 @@ optionally, `elsif` and `else`) clause:
|
|||||||
{% endunless %}
|
{% endunless %}
|
||||||
```
|
```
|
||||||
|
|
||||||
```liquid
|
|
||||||
# Check if the user has a credit card
|
|
||||||
{% if user.creditcard != null %}
|
|
||||||
poor sob
|
|
||||||
{% endif %}
|
|
||||||
```
|
|
||||||
|
|
||||||
```liquid
|
|
||||||
# Same as above
|
|
||||||
{% if user.creditcard %}
|
|
||||||
poor sob
|
|
||||||
{% endif %}
|
|
||||||
```
|
|
||||||
|
|
||||||
```liquid
|
```liquid
|
||||||
# Check for the size of an array
|
# Check for the size of an array
|
||||||
{% if user.payments == empty %}
|
{% if user.payments == empty %}
|
||||||
@@ -176,7 +169,6 @@ optionally, `elsif` and `else`) clause:
|
|||||||
{% if user.payments.size > 0 %}
|
{% if user.payments.size > 0 %}
|
||||||
you paid !
|
you paid !
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```liquid
|
```liquid
|
||||||
|
|||||||
Reference in New Issue
Block a user