Skip to content

Commit

Permalink
Add layout grid
Browse files Browse the repository at this point in the history
  • Loading branch information
cetinajero committed Jan 29, 2018
1 parent ae8bf2c commit 2ecf792
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions _layouts/grid.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
layout: page
---
<div class="container">
<div class="row">
{% assign collections = site.collections | where: "label", page.collection %}
{% for collection in collections %}
{% assign docs = collection.docs | where: "menu-father", page.menu-name %}
{% for doc in docs %}
{% assign url-size = doc.url | size | minus: 2 %}
{% assign i18n-id = doc.url | slice: 1,url-size | replace: '/', '-' | remove_first: collection.label | remove_first: '-' %}
{% assign i18n-title = site.data.i18n.catalog[collection.label][site.lang][i18n-id].title %}
{% assign i18n-description = site.data.i18n.catalog[collection.label][site.lang][i18n-id].desc %}
<div class="col-xs-6 col-sm-4 col-md-3">
<div>
<a {% if doc.menu-name or collection.products.detail or doc.menu-name %}{{ doc.url | prepend: 'href="' | append: '"' }}{% endif %}>
<img id="{{ i18n-id }}" class="product-image" src="{{ doc.image }}" alt="{% if i18n-title %}{{ i18n-title }}{% else %}{{ doc.title }}{% endif %}" />
</a>
</div>
<div class="product-model">
<a id="{{ i18n-id }}" {% if doc.menu-name or collection.products.detail or doc.menu-name %}{{ doc.url | prepend: 'href="' | append: '"' }}{% endif %}>{% if i18n-title %}{{ i18n-title }}{% else %}{{ doc.title }}{% endif %}</a>
</div>
<div class="product-brand">{{ doc.brand }}</div>
<div id="{{ i18n-id }}" class="product-description">{% if i18n-description %}{{ i18n-description }}{% else %}{{ doc.description }}{% endif %}</div>
<div class="product-price"><span class="label label-primary">{{ doc.price }}</span></div>
</div>
{% endfor %}
{% endfor %}
</div>
</div> <!-- /container -->

0 comments on commit 2ecf792

Please sign in to comment.