SEOshop Documentation

HTML filters

raw

The raw filter marks the value as being "safe", which means that in an environment with automatic escaping enabled this variable will not be escaped if raw is the last filter applied to it:

{% autoescape true %}
  {{ var | raw }} {# var won't be escaped #}
{% endautoescape %}

nl2br

The nl2br filter inserts HTML line breaks before all newlines in a string.

{{ "I like Rain.\nYou will like it too." | nl2br }}

Outputs:

I like Rain.
You will like it too.

color_mix

The color_mix filter can be used to mix colors. This is especially useful when you want to lighten or darken a hex color or when you are creating a theme.

The color_mix filter takes 2 arguments. Argument 1 is the secondary color u want to mix with the primary color. Argument 2 is the amount (0 - 1.0) of the secondary color u want to mix with the primary color.

{# lighten the color red #}
{{ '#FF0000' | color_mix('#FFFFFF', 0.2) }}

{# darken the color red #}
{{ '#FF0000' | color_mix('#000000', 0.2) }}

Outputs:

# FF3333
# CC0000
Was this article helpful? Yes No
One moment please
Thanks for your feedback.