title: I want to avoid button repetition
body: <p>I display the content of the category and I display the button "displays more" if I have other content but the button has been marked according to the number of ads in the category, and when I paste the button outside "for" I get always this button even when the category content is empty</p>
  
  <pre><code> &lt;div class="pedagogical pedagogical--category js-pedagogical-items" data-type="category" data-nbdisplayed="4"&gt;
          {% for categoryId in questionCategories %}
              &lt;div class="row pedagogical__items" data-type="category" data-value="{{ categoryId }}"&gt;
                  {% for tool in tools if tool.questionCategory == categoryId %}
                      &lt;div class="col-12 col-md-6 pedagogical__item__wrapper"&gt;
                          {% include 'components/tool-preview-item.html.twig' with {'tool' : tool} %}
                      &lt;/div&gt;
                      &lt;div class="col-12 text-center"&gt;
                          &lt;button class="btn btn-outline-secondary js-show-more" data-type="category" data-value="{{ categoryId }}"&gt;{{ 'show-more'|trans({}, 'action') }}&lt;/button&gt;
                      &lt;/div&gt;
                  {% endfor %}
              &lt;/div&gt;
          {% endfor %}
      &lt;/div&gt;
  </code></pre>