I am trying to set an if
statment that will show a li
if there is only one entry displaying. The issue I am having is that this entry is put into two different places via checking if it contains a checkbox.
I can only seem to managed to get it to display all the time or not at all
The code I have at the moment is this
{% if entry.ENTRYNAME.contains('CHECKBOX OPTION') == 0 %} <li>CONTENT</li> {% endif %}
But that does not seem to work.
I am using the Check box contains option else where and it works fine. It's just the value check that I cannot seem to get to work. I've also tried adding both .length
and |length
but neither of those seem to work.
ENTRYNAME
in your example? Is that an Entries field (buildwithcraft.com/docs/entries-fields)?ENTRYNAME
Is actuallyFIELDNAME
which is a checkbox field. I figured out how to solve the issue and have posted the answer bellow