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, 8 months ago
Updated 7 February 2024, 5 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.69.0 2024