ungleich-staticcms/templates/macros/product.html

27 lines
858 B
HTML
Raw Permalink Normal View History

2019-12-30 20:40:48 +00:00
{% macro render_product(product, from_index=false) %}
{% if from_index %}
<div class="post-preview">
<div class="row">
<div class="col-md-4">
{% set image = product.attachments.images.first() %}
<h2><a href="{{ product|url }}">{% if image %}<img src="{{ image.thumbnail(240)|url }}" alt=""/>{% else %}<div class="blog-post-placeholder"></div>{% endif %}</a></h2>
2019-12-30 20:46:33 +00:00
</div>
2019-12-30 20:40:48 +00:00
<div class="col-md-8">
{% if from_index %}<a href="{{ product|url }}"><h2 class="post-title">{{ post.title }}</h2></a>
{% else %}
<h2 class="post-title">{{ product.title }}</h2>
{% endif %}
<p class="post-subtitle">
<p>
{{ product.abstract }}
</p>
</p>
</div>
</div>
<hr>
</div>
{% else %}
{{ product.body }}
{% endif %}
{% endmacro %}