K
K
Kirill2020-11-11 18:41:57
Drupal
Kirill, 2020-11-11 18:41:57

How to pass variable value to child template?

field--node--field-1.html.twig template

{% set count  = 0 %}
        {% for item in items %}
            {% set count  = count  + 1 %}
            {{ item.content }}
        {% endfor %}

it outputs taxonomy terms taxonomy-term--name.html.twig
how do i check in taxonomy-term
{% if count == 1 %}
in field shove
{% include 'themes/custom/my-theme/templates/content/taxonomy-term--name.html.twig' with {'count':count} %}
nothing comes out

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
andead, 2020-11-11
@andead

No way

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question