Closed challmand closed 2 years ago
You can use boards.length
:
{% ifequal cards.length 3 %}
yes :)
{% else %}
no :(
{% endifequal %}
or {% if cards.length == 3 %}
this will call (length boards)
.
Maybe more examples can be added in the documentation?
You can use
boards.length
:{% ifequal cards.length 3 %} yes :) {% else %} no :( {% endifequal %}
or
{% if cards.length == 3 %}
this will call
(length boards)
.Maybe more examples can be added in the documentation?
Thank you, just what I needed. I was taking the documentation too literally and did not see that variation.
Hello I am trying to use the length filter to see if my list is a specific size.
{% if list | length >= 2 %} does not work {% if list | length_is:"2" %} does not work
creating my own filter to do the logic I want does not work.
Is there something I am missing? I get the following errors:
How can I make a comparison boolean statement that works with if conditionals?
If I set the boards length to a variable i pass into the template the comparisons works fine, its only when I want to compare the length of a list inside the template I have the issues.
Appreciate any help.