I have a twig template for some text field. Inside it I'm displaying the value like (it's single value field):
{% for item in items %}
{{ item.content}}
{% endfor %}
And it's displaying value correctly, which means that inside that loop item.content
contains correct value.
Now, field value actually contains tags, i.e. value is "tag1 tag2 tag 3". And I want to split that value by space sign. So I tried something like:
{% for item in items %}
{% set tags = item.content|split(' ') %}
{{ dump(tags) }}
{{ item.content}}
{% endfor %}
And this split function should return list of elements 'tag1', 'tag2', 'tag3', according to documentation: https://twig.symfony.com/doc/2.x/filters/split.html
But instead, this dump call prints out null ?!?!
Why is that happening?