I’ve cloned the HubSpot’s boilerplate “blog-listings” module from this file on Github. Then I updated the template type so this module is accessible both in Blog Listings, and Pages:
This module uses a for-loop to iterate through the listings
{% for content in contents %}
So I’ve created a simple output of “contents” to see the data that’s available.
<section class="blog-index">
<h3>Below is the blog content array:</h3>
<p>{{ contents }}</p>
</section>
When I add this module to my “Blog Listings Page”, the contents are populated, and the loop does execute. However, when I add this module to any “Website Page”, for example my homepage, the contents are empty, and the loop does not execute.
<!-- Output on blog-index page -->
<section class="blog-index">
<h3>Below is the blog content array:</h3>
<p>[BlogPost XXXXXXXXXX Blog Title]</p>
</section>
<!-- Output on homepage -->
<section class="blog-index">
<h3>Below is the blog content array:</h3>
<p></p>
</section>
Is there a way to access the blog-listings data from any standard “Website Page”?
