Skip to main content

Twig error

Twig\Error\SyntaxError: Unknown "filter" tag. in Twig\Parser->subparse() (line 6 of themes/custom/{theme}/templates/views/views-view-field--products--field_product_type.html.twig).

Line 6 of the views-view-field--products--field_product_type.html.twig file is 

{% filter upper|escape('html') %}

The actual Twig file code

{% filter upper|escape('html') %}
    {{ view.field.field_product_type.original_value  -}}
{% endfilter %}

In Drupal 10, this is producing the error noted above - Unknown "filter" tag



Change the code as follows

{{ view.field.field_product_type.original_value|upper|escape('html') -}}


Related articles

Andrew Fletcher31 May 2024
Connecting AWS S3 with Docker for Drupal 10
Recently, I encountered an issue where my local Docker environment refused to connect to AWS S3, although everything worked seamlessly in AWS-managed environments. This challenge was not just a technical hurdle; it was a crucial bottleneck that needed resolution to ensure smooth Drupal deployments...