I have a twig template where I would like to test if an item begins with a certain value
{% if item.ContentTypeId == \'0x0120\' %}
-
You can just use the slice filter. Simply do:
{% if item.ContentTypeId[:6] == '0x0120' %}
{% endif %}
- 热议问题