Skip to content

Instantly share code, notes, and snippets.

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