Skip to content

Instantly share code, notes, and snippets.

@seb-thomas
Created July 29, 2015 15:02
Show Gist options
  • Select an option

  • Save seb-thomas/21668b159d8178219a99 to your computer and use it in GitHub Desktop.

Select an option

Save seb-thomas/21668b159d8178219a99 to your computer and use it in GitHub Desktop.
Craft SuperTable in a Matrix, implementing variable column width
<div class="module casestudy-awards">
<div class="container">
{% for block in entry.awards %}
<div class="row">
<div class="col-sm-12">
<h3 class="module-title">
{%- if block.moduleTitle | length -%}
{{- block.moduleTitle -}}
{%- else %}Awards won{% endif -%}
</h3>
</div>
</div>
<div class="row">
{% set colCount = block.award | length %}
{% for column in block.award %}
<div class="col-sm-{% if colCount == 1 %}12{% elseif colCount == 2 %}6{% elseif colCount == 3 %}4{% endif %}">{{ column.awardTitle }}</div>
{% endfor %}
</div>
{% endfor %}
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment