{% set first = 1 %}
{% for dataId,data in  block.data[code]|default(null) %}
  {% if first == 1 %}
    <li class="poster-table active">
      <a class="poster-btn" href="#poster-{{ dataId }}" data-toggle="tab">{{ data.alt }}</a>
      <input type="hidden" name="data[{{ code }}][{{ dataId }}][alt]" value="{{ data.alt }}">
    </li>
  {% else %}
    <li class="poster-table">
      <a class="poster-btn" href="#poster-{{ dataId }}" data-toggle="tab">{{ data.alt }}</a>
      <input type="hidden" name="data[{{ code }}][{{ dataId }}][alt]" value="{{ data.alt }}">
    </li>
  {% endif %}
  {% set first = 0 %}

{% endfor %}