Last active
August 29, 2015 14:22
-
-
Save johanbove/e6aae743e82ab9fb7bc8 to your computer and use it in GitHub Desktop.
liquid template blocks with columns
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
{% for block in site.data.[site.lang].general.footer.blocks %} | |
{% assign colCount = forloop.length | plus: 1 %} | |
{% assign colWidth = 12 | divided_by: colCount %} | |
<div class="col-md-{{ colWidth }} col-xs-6"> | |
<h5>{{ block.title }}</h5> | |
<ul> | |
{% if block.links != empty %} | |
{% for linkElement in block.links %} | |
<li><a href="{% if linkElement.permalink != null %} {{ linkElement.permalink | prepend: site.baseurl }} {% else %} {{ linkElement.link }} {% endif %}" {% if linkElement.link != null %}target="_blank"{% endif %}>{{ linkElement.text }}</a></li> | |
{% endfor %} | |
{% endif %} | |
{% if block.contacts != empty %} | |
{% for contactElement in block.contacts %} | |
<li>{{ contactElement.label }} {{ contactElement.value }}</li> | |
{% endfor %} | |
{% endif %} | |
</ul> | |
</div> | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment