Multiple replaces on field


I have a question about the replace: option as described in “Changing a form tilte” by TUT.
I want to use multiple replaces in a {{ field.label }}. something like this {{ field.label | Replace “Document Date”, “Date” | Replace “Document Number”, “No.” }}

Is this possible?

yes it is…

just change

<div><b> {{ field.label }}:</b> {{ field.text }}</div>


<div><b> INVOICE #:</b> {{ field.text }}</div>

in the above example i changed Invoice number to ’ INVOICE #:

here is a preview: hope it helped

I think @Jasper_Kimmel’s question was whether you can replace multiple labels. The answer is that it would not be so simple. The technique in the Guide and the one referred to by @JakeJoke are two different ways of changing a single entry on a form. The Guide’s method is more flexible, as it leaves other forms unaffected. @JakeJoke’s method is a hard change. But changing a bunch of field labels would require rewriting much of the theme. It could be done, but probably not by someone who is asking whether it can be.

Thanks @tut @JakeJoke. Probably need to put this in the HTML:
{% if field.label contains ‘Documentdatum’ %} {{ field.label | replace: “Documentdatum”, “Datum:” }} {% elsif field.label contains ‘Referentie #’ %} {{ field.label | replace: “Referentie #”, “Offertenummer:” }} {% else %} {{ field.label}} {% endif %}

I would be curious to know if that works. I am not sure whether all Liquid syntax is supported.

IT did @Tut

If it helps, also works this approach (mixed with custom fields):

{% if title == 'Purchase Order' %} New Tile 1 {% endif %}
{% if title == 'Invoice' %} {% for field in custom_fields %} {% if field.label != 'CUSTOM FIELD' %}{% continue %}{% endif %}
{{ field.text }}
{% endfor %}{% endif %}
{% if title == 'Purchase Invoice' %} New Title 2 {% endif %}