Check whether string contains a substring

Hi there,

I have the following code:

    {% if person.name contains 'NV' %}
    {{ person.name }}
  {% endif %}
{% endfor %}

Looked up the ‘contains’ operator in shopify (and it is documented here), but the results where not there in Silverfin (I get a ‘Liquid error: undefined method `text_properties’ for’ … any ideas?

Thanks!

Sorry, complete code:

{% for person in period.people %}
  {% if person.name contains 'NV' %}
    {{ person.name }}
  {% endif %}
{% endfor %}

Hi Bart

This is a bug which we will solve in the near future.
For the moment, we have a work around which solves your problem.

{% for person in period.people %}
  {% capture naam %}{{ person.name }}{% endcapture %}
  {% if naam contains 'NV' %}
    {{ person.name }}
  {% endif %}
{% endfor %}

Kind regards
Sam

Thanks Sam,

I have a different problem and I wonder whether this is one is related to the one mentioned.

´´´
{% if $0 < $3 %}
{% assign custom.booleans.Boo_Art215_1 = true %}
{% endif %}
´´´

If I output a result based on the ‘if’ ($0 < $3), the result is correct. However, if I want to output the same result based on the assign-statement ({% if custom.booleans.Boo_Art215_1 == true %}, the output is different!

I checked and it appears there is no assignment (the variable custom.booleans.Boo_Art215_1 is empty!).

How can I solve this? Thanks!

Problem solved! Don’t bother …