Created
May 19, 2015 14:21
-
-
Save MisterPoppet/523b048f91b1676b5b3a to your computer and use it in GitHub Desktop.
Columns with a Matrix Field
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% set inColumn = false %} | |
{% for block in entry.body %} | |
{% switch block.type %} | |
{% case 'columnBlock' %} | |
{% if inColumn %} | |
</div> | |
{% else %} | |
{% set inColumn = true %} | |
<div class="lucky grid"> | |
{% endif %} | |
<div class="{{ block.mobileSize }} {{ block.desktopSize }} column"> | |
{% case 'headerBlock' %} | |
<h{{ block.size }}>{{ block.textContent }}</h{{ block.size }}> | |
{% case 'textBlock' %} | |
{{ block.textContent }} | |
{% case 'imageBlock' %} | |
<img class="{{ block.position }}" src="{{ block.imageContent.first().url }}"> | |
{% endswitch %} | |
{% endfor %} | |
{% if inColumn %} | |
</div></div> | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment