Skip to content

Instantly share code, notes, and snippets.

@backlineint
Created April 3, 2017 21:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save backlineint/1166067639ac3f957e4b9ff02c632a9e to your computer and use it in GitHub Desktop.
Save backlineint/1166067639ac3f957e4b9ff02c632a9e to your computer and use it in GitHub Desktop.
Setting a Tab Index in a Twig Template
<section class="m-facet-checkboxes block-facet--checkbox">
<h2 class="block-title">{{ facet_checkboxes.block_title }}</h2>
<ul class="js-facets-checkbox-links">
{% for item in facet_checkboxes.checkboxes %}
{% set counter = ( counter | default(0) ) + 1 %}
<li class="facet-item">
<input type="checkbox" class="facets-checkbox" tabindex="{{ counter }}" id="{{ item.id }}">
<label for="{{ item.id }}">
<span class="facet-item__value">{{ item.label }}</span>
{% if item.count %}
<span class="facet-item__count">({{ item.count }})</span>
{% endif %}
</label>
</li>
{% endfor %}
</ul>
<a href="#" class="facets-soft-limit-link">Show more</a>
</section>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment