Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save apsolut/3935b5ad3a7374623c3f45a55e9efbc1 to your computer and use it in GitHub Desktop.
Save apsolut/3935b5ad3a7374623c3f45a55e9efbc1 to your computer and use it in GitHub Desktop.
<div class="post-listing">
{% set post_ids = [] %}
{% for post_item in module.posts %}
{% do post_ids.append(post_item.post_id) %}
{% endfor %}
{% set contents = content_by_ids(post_ids) %}
{% for content in contents %}
<div class="post-item">
<a href="{{ content.absolute_url }}">
{% if content.featured_image %}
<div class="post-image">
{% set featuredImage = content.post_list_summary_featured_image %}
{% set featuredImageURL = resize_image_url(featuredImage, 0, 0, 400, true, true) %}
<img src="{{ featuredImageURL }}" alt="{{ content.title }}" class="img-responsive" />
</div>
{% else %}
<div class="post-image" style="background-color: #f2f6f7;"></div>
{% endif %}
<h3 class="post-title">
{{ content.name }}
</h3>
</a>
</div>
{% endfor %}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment