{% if (entry.pageWithGroupIndex|length) > 0 %}
  {% set groups = entry.pageWithGroupIndex.level(1).all() %}

  {% include 'quarks/_indexCompenents' with {
    title: 'Índice de página',
    typeGroup: true,
    elements: groups,
    typeSlider: typeSlider
  } only %}

  {% for group in groups %}
    {% if group.children.count() > 0 %}
      {% set count = loop.index %}
      {% if (group.fieldText|length) > 0 %}
        <h2 class="masterCategory py-4"
          id="item-{{ group.type }}-{{ loop.index }}">
          {{ group.fieldText }}
        </h2>
      {% endif %}
      {% for i in group.children.all() %}
        {% include 'components/_' ~ i.type with {
          id: 'item-' ~ i.type ~ '-' ~ count ~ '-' ~ loop.index0,
          component: i,
          index: loop
        } only %}
      {% endfor %}
    {% endif %}
  {% endfor %}
{% endif %}
