<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Getting blog listing data from a module in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Getting-blog-listing-data-from-a-module/m-p/1045380#M40743</link>
    <description>&lt;P&gt;Hello guys! How are you?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on getting data from a Blog Listing Module to a Webpage, actually the module if working smoothly on the Blog Templates but i can't make it work on Website Pages. On the Blogs its works like you can see on the attatched photo.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-09-24 at 15.58.46.jpg" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/127713iA2E1B6EE64BC4810/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-09-24 at 15.58.46.jpg" alt="Screenshot 2024-09-24 at 15.58.46.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But on the website pages but it doesn't show. As you can see in the next photo. It should be available on the section marked with a red rectangle.&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-09-24 at 16.03.30.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/127714iD2034E9B81EAED51/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-09-24 at 16.03.30.png" alt="Screenshot 2024-09-24 at 16.03.30.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The layout that is not being viewed is the next one:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;section class="hs-blog-post-listing hs-blog-post-listing--{{ layout }}"&amp;gt;
  {% for content in contents %}

    {# Blog listing article #}

    &amp;lt;article
      class="hs-blog-post-listing__post hs-blog-post-listing__post--{{ layout }} {{ "hs-blog-post-listing__post--{{ columns }}" if has_columns }}"
      {% if has_full_image and content.featured_image %}
        style="background-image: url({{ content.featured_image }});"
      {% endif %}
      aria-label="{{ module.default_text.full_blog_post_summary_text }}"
    &amp;gt;

      {# Adds a wrapper for an overlay if full image is enabled #}

      {% if has_full_image and content.featured_image %}
        &amp;lt;div class="hs-blog-post-listing__post-inner-wrapper"&amp;gt;
      {% endif %}

        {# Post image #}

        {% if not has_alternate_image or loop.index is not divisibleby 2 %}
          {{ post_image("left") }}
        {% elif has_alternate_image and loop.index is divisibleby 2 %}
          {{ post_image("right") }}
        {% endif %}

        {# Article content #}

        {{ post_content() }}

      {# Adds a wrapper for an overlay if full image is enabled #}

      {% if has_full_image and content.featured_image %}
        &amp;lt;/div&amp;gt;
      {% endif %}

    &amp;lt;/article&amp;gt;
  {% endfor %}

&amp;lt;/section&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks guys!&lt;/P&gt;</description>
    <pubDate>Tue, 24 Sep 2024 19:07:52 GMT</pubDate>
    <dc:creator>DEsteva</dc:creator>
    <dc:date>2024-09-24T19:07:52Z</dc:date>
    <item>
      <title>Getting blog listing data from a module</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Getting-blog-listing-data-from-a-module/m-p/1045380#M40743</link>
      <description>&lt;P&gt;Hello guys! How are you?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on getting data from a Blog Listing Module to a Webpage, actually the module if working smoothly on the Blog Templates but i can't make it work on Website Pages. On the Blogs its works like you can see on the attatched photo.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-09-24 at 15.58.46.jpg" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/127713iA2E1B6EE64BC4810/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-09-24 at 15.58.46.jpg" alt="Screenshot 2024-09-24 at 15.58.46.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But on the website pages but it doesn't show. As you can see in the next photo. It should be available on the section marked with a red rectangle.&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-09-24 at 16.03.30.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/127714iD2034E9B81EAED51/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-09-24 at 16.03.30.png" alt="Screenshot 2024-09-24 at 16.03.30.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The layout that is not being viewed is the next one:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;section class="hs-blog-post-listing hs-blog-post-listing--{{ layout }}"&amp;gt;
  {% for content in contents %}

    {# Blog listing article #}

    &amp;lt;article
      class="hs-blog-post-listing__post hs-blog-post-listing__post--{{ layout }} {{ "hs-blog-post-listing__post--{{ columns }}" if has_columns }}"
      {% if has_full_image and content.featured_image %}
        style="background-image: url({{ content.featured_image }});"
      {% endif %}
      aria-label="{{ module.default_text.full_blog_post_summary_text }}"
    &amp;gt;

      {# Adds a wrapper for an overlay if full image is enabled #}

      {% if has_full_image and content.featured_image %}
        &amp;lt;div class="hs-blog-post-listing__post-inner-wrapper"&amp;gt;
      {% endif %}

        {# Post image #}

        {% if not has_alternate_image or loop.index is not divisibleby 2 %}
          {{ post_image("left") }}
        {% elif has_alternate_image and loop.index is divisibleby 2 %}
          {{ post_image("right") }}
        {% endif %}

        {# Article content #}

        {{ post_content() }}

      {# Adds a wrapper for an overlay if full image is enabled #}

      {% if has_full_image and content.featured_image %}
        &amp;lt;/div&amp;gt;
      {% endif %}

    &amp;lt;/article&amp;gt;
  {% endfor %}

&amp;lt;/section&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks guys!&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2024 19:07:52 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Getting-blog-listing-data-from-a-module/m-p/1045380#M40743</guid>
      <dc:creator>DEsteva</dc:creator>
      <dc:date>2024-09-24T19:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: Getting blog listing data from a module</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Getting-blog-listing-data-from-a-module/m-p/1045398#M40744</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/620365"&gt;@DEsteva&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The `contents` &lt;A href="https://developers.hubspot.com/docs/cms/hubl/variables#blog-variables" target="_blank" rel="noopener"&gt;variable&lt;/A&gt; is only available on the blog listing page, so you can't loop through it on a website page.&lt;/P&gt;
&lt;P&gt;In that case, you can use the &lt;A href="https://developers.hubspot.com/docs/cms/hubl/functions#blog-recent-posts" target="_blank" rel="noopener"&gt;blog_recent_posts&lt;/A&gt; function on a website page to retrieve your blog posts. You can pass 'default' as the first parameter to retrieve the primary blog or pass the ID of a specific blog.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could try updating your code to something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% set posts = contents ? contents : blog_recent_posts("default", 200) %}

&amp;lt;section class="hs-blog-post-listing hs-blog-post-listing--{{ layout }}"&amp;gt;
  {% for content in posts %}

    {# Blog listing article #}

    &amp;lt;article
      class="hs-blog-post-listing__post hs-blog-post-listing__post--{{ layout }} {{ "hs-blog-post-listing__post--{{ columns }}" if has_columns }}"
      {% if has_full_image and content.featured_image %}
        style="background-image: url({{ content.featured_image }});"
      {% endif %}
      aria-label="{{ module.default_text.full_blog_post_summary_text }}"
    &amp;gt;

      {# Adds a wrapper for an overlay if full image is enabled #}

      {% if has_full_image and content.featured_image %}
        &amp;lt;div class="hs-blog-post-listing__post-inner-wrapper"&amp;gt;
      {% endif %}

        {# Post image #}

        {% if not has_alternate_image or loop.index is not divisibleby 2 %}
          {{ post_image("left") }}
        {% elif has_alternate_image and loop.index is divisibleby 2 %}
          {{ post_image("right") }}
        {% endif %}

        {# Article content #}

        {{ post_content() }}

      {# Adds a wrapper for an overlay if full image is enabled #}

      {% if has_full_image and content.featured_image %}
        &amp;lt;/div&amp;gt;
      {% endif %}

    &amp;lt;/article&amp;gt;
  {% endfor %}

&amp;lt;/section&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2024 19:41:59 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Getting-blog-listing-data-from-a-module/m-p/1045398#M40744</guid>
      <dc:creator>Teun</dc:creator>
      <dc:date>2024-09-24T19:41:59Z</dc:date>
    </item>
  </channel>
</rss>

