Last active
October 1, 2024 18:03
-
-
Save apsolut/4bf16df52f65b3495e39d46a9726dfdb to your computer and use it in GitHub Desktop.
HubSpot get posts on page - landing page
This file contains hidden or 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
<div class="post-showcase"> | |
{% 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"> | |
{% if content.featuredImage %} | |
<img src="{{ content.featuredImage }}" alt="{{ content.name }}" class="post-image"> | |
{% endif %} | |
<h2 class="post-title"> | |
<a href="{{ content.absolute_url }}">{{ content.name }}</a> | |
</h2> | |
</div> | |
{% endfor %} | |
</div> |
This file contains hidden or 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
<div class="post-showcase" > | |
{% for post_item in module.posts %} | |
{% set post = blog_post_by_id(post_item.post_id) %} | |
{% if post %} | |
<div class="post-item"> | |
{{ post }} | |
{% if post.featured_image %} | |
<img src="{{ post.featured_image }}" alt="{{ post.name }}" class="post-image"> | |
{% endif %} | |
<h2 class="post-title"> | |
<a href="{{ post.absolute_url }}">{{ post.name }}</a> | |
</h2> | |
</div> | |
{% endif %} | |
{% endfor %} | |
</div> |
This file contains hidden or 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
{% set contents = content_by_ids([179840588455, 179494974230, 179494974111]) %} | |
<ul> | |
{% for content in contents %} | |
<li> | |
<a href="{{ content.absolute_url }}">{{content.title}}</a> | |
</li> | |
{% endfor %} | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment