Twig\Error\SyntaxError: Unexpected token "name" of value "if" ("end of statement block" expected). in Twig\TokenStream->expect() (line 56 of /home/public_html/modules/contrib/ixm_blocks/modules/ixm_blocks_statistics/templates/block--ixm-blocks-statistics.

Created on 1 November 2023, about 1 year ago
Updated 7 February 2024, 11 months ago

Problem/Motivation

I placed a Statistics block on a page and got the error,

Twig\Error\SyntaxError: Unexpected token "name" of value "if" ("end of statement block" expected). in Twig\TokenStream->expect() (line 56 of /home/public_html/modules/contrib/ixm_blocks/modules/ixm_blocks_statistics/templates/block--ixm-blocks-statistics.html.twig).

I put the if statement on a separate line like this,

{% for key, item in content.field_entity_reference_paragraph %}
  {% if key|first != '#' %}

and the error went away but the statistics numbers just output zeros and no counts.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇳🇬Nigeria chike Nigeria

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024