<?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 Re: Related blog posts HubL tag in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Related-blog-posts-HubL-tag/m-p/321991#M15545</link>
    <description>&lt;P&gt;Thank you so much for the reply, &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/91608"&gt;@alyssamwilie&lt;/a&gt;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried adding your code to the blog post template code but it won't let me publish it. I'm getting an error. Any ideas as to what the reason could be? Here is a copy of the code and I've marked the related blog posts part in red comments.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;div class="blog-section"&amp;gt;&lt;BR /&gt;&amp;lt;div class="blog-post-wrapper cell-wrapper"&amp;gt;&lt;BR /&gt;&amp;lt;div class="blog-section"&amp;gt;&lt;BR /&gt;&amp;lt;div class="blog-post-wrapper cell-wrapper"&amp;gt;&lt;BR /&gt;&amp;lt;!-- &amp;lt;img src="{{ content.featured_image }}" class="featured-image" /&amp;gt; --&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;div class="share-post"&amp;gt;&lt;BR /&gt;&amp;lt;h3 class="share text-center"&amp;gt;Share:&amp;lt;/h3&amp;gt;&lt;BR /&gt;{% widget_block social_sharing "social_sharing" label='Social Sharing', use_page_url=True, overrideable=False %}&lt;BR /&gt;{% widget_attribute "twitter" is_json=True %}{"link_format": "&lt;A href="https://twitter.com/intent/tweet?original_referer=" target="_blank"&gt;https://twitter.com/intent/tweet?original_referer=&lt;/A&gt;{{ social_link_url }}&amp;amp;url={{ social_link_url }}&amp;amp;source=tweetbutton&amp;amp;text={{ social_page_title }}", "network": "Twitter", "default": true, "enabled": true, "custom_link_format": "", "img_src": "&lt;A href="https://static.hubspot.com/final/img/common/icons/social/twitter-24x24.png" target="_blank"&gt;https://static.hubspot.com/final/img/common/icons/social/twitter-24x24.png&lt;/A&gt;", "custom_link": ""}{% end_widget_attribute %}&lt;BR /&gt;{% widget_attribute "linkedin" is_json=True %}{"link_format": "&lt;A href="http://www.linkedin.com/shareArticle?mini=true&amp;amp;url=" target="_blank"&gt;http://www.linkedin.com/shareArticle?mini=true&amp;amp;url=&lt;/A&gt;{{ social_link_url }}", "network": "LinkedIn", "default": true, "enabled": true, "custom_link_format": "", "img_src": "&lt;A href="https://static.hubspot.com/final/img/common/icons/social/linkedin-24x24.png" target="_blank"&gt;https://static.hubspot.com/final/img/common/icons/social/linkedin-24x24.png&lt;/A&gt;", "custom_link": ""}{% end_widget_attribute %}&lt;BR /&gt;{% widget_attribute "google_plus" is_json=True %}{"link_format": "&lt;A href="https://plus.google.com/share?url=" target="_blank"&gt;https://plus.google.com/share?url=&lt;/A&gt;{{ social_link_url }}", "network": "Google+", "default": true, "enabled": true, "custom_link_format": "", "img_src": "&lt;A href="https://static.hubspot.com/final/img/common/icons/social/googleplus-24x24.png" target="_blank"&gt;https://static.hubspot.com/final/img/common/icons/social/googleplus-24x24.png&lt;/A&gt;", "custom_link": ""}{% end_widget_attribute %}&lt;BR /&gt;{% widget_attribute "facebook" is_json=True %}{"link_format": "&lt;A href="http://www.facebook.com/share.php?u=" target="_blank"&gt;http://www.facebook.com/share.php?u=&lt;/A&gt;{{ social_link_url }}", "network": "Facebook", "default": true, "enabled": true, "custom_link_format": "", "img_src": "&lt;A href="https://static.hubspot.com/final/img/common/icons/social/facebook-24x24.png" target="_blank"&gt;https://static.hubspot.com/final/img/common/icons/social/facebook-24x24.png&lt;/A&gt;", "custom_link": ""}{% end_widget_attribute %}&lt;BR /&gt;{% widget_attribute "email" is_json=True %}{"link_format": "mailto:?subject=Check out {{ social_link_url }} &amp;amp;body=Check out {{ social_link_url }}", "network": "Email", "default": true, "enabled": true, "custom_link_format": "", "img_src": "&lt;A href="https://static.hubspot.com/final/img/common/icons/social/email-24x24.png" target="_blank"&gt;https://static.hubspot.com/final/img/common/icons/social/email-24x24.png&lt;/A&gt;", "custom_link": ""}{% end_widget_attribute %}&lt;BR /&gt;{% end_widget_block %}&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;article class="post-body"&amp;gt;&lt;BR /&gt;{{ content.post_body }}&lt;BR /&gt;&amp;lt;/article&amp;gt;&lt;BR /&gt;&lt;BR /&gt;{% choice "optional_CTA" label="&amp;lt;span style=color:#e8771b;&amp;gt;Do you want to show the optional call-to-action?&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span&amp;gt;Hit Save to refresh the preview.&amp;lt;/span&amp;gt;", choices="No,Yes", export_to_template_context=True %}&lt;BR /&gt;{% text "call_to_action" label="Call to action", export_to_template_context=True %}&lt;BR /&gt;{% cta "cta" label="CTA button", export_to_template_context=True %}&lt;/P&gt;&lt;P&gt;{% if widget_data.optional_CTA.value == "Yes" %}&lt;BR /&gt;&amp;lt;hr&amp;gt;&lt;BR /&gt;&amp;lt;h3 style="text-align: center; font-size: 1.6em; line-height: 1.4em; margin-top: 20px; margin-bottom: 45px;"&amp;gt;{% text "call_to_action" label="Call to action", no_wrapper=True %}&amp;lt;/h3&amp;gt;&lt;BR /&gt;&amp;lt;div style="text-align:center;margin-bottom:1em"&amp;gt;{% cta "cta" label="CTA button", no_wrapper=True %}&amp;lt;/div&amp;gt;&lt;BR /&gt;{% endif %}&lt;BR /&gt;&lt;BR /&gt;&amp;lt;div class="section section-narrow post-pagination no-padding-bottom"&amp;gt;&lt;BR /&gt;{% if content.next_post_slug %}&amp;lt;a href="/{{ content.next_post_slug }}" class="prev-post-link"&amp;gt;Previous Post&amp;lt;/a&amp;gt;{% endif %}&lt;BR /&gt;{% if content.previous_post_slug %}&amp;lt;a href="/{{ content.previous_post_slug }}" class="next-post-link"&amp;gt;Next Post&amp;lt;/a&amp;gt;{% endif %}&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&amp;lt;!-- related blog posts section starts here --&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&amp;lt;div class="row-fluid "&amp;gt;&lt;BR /&gt;&amp;lt;div class="span12 widget-span widget-type-raw_jinja " style="" data-widget-type="raw_jinja" data-x="0" data-w="12"&amp;gt;&lt;BR /&gt;{% set post_tags = content.tagList|join(", ") %}&lt;BR /&gt;{% related_blog_posts limit=3, tags="{{ post_tags }}" post_formatter="blog_post_formatter" %}&lt;/P&gt;&lt;P&gt;{% for post in posts %}&lt;BR /&gt;&amp;lt;div class="span4"&amp;gt;&lt;BR /&gt;&amp;lt;div class="post-card {% for topic in post.topic_list %}{{ topic.slug }}{% if not loop.last %} {% endif %} {% endfor %} bh-ver"&amp;gt;&lt;BR /&gt;&amp;lt;div class="bh-hor"&amp;gt;&lt;BR /&gt;&amp;lt;a href="{{ post.absolute_url }}"&amp;gt;&lt;BR /&gt;&amp;lt;div class="ft-image" style="background: url('{{ post.featured_image }}') center no-repeat;"&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;div class="content"&amp;gt;&lt;BR /&gt;&amp;lt;h5&amp;gt;{{ post.name }}&amp;lt;/h5&amp;gt;&lt;BR /&gt;&amp;lt;p&amp;gt;{{ post.publish_date|datetimeformat('%B %e, %Y') }}&amp;lt;/p&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/a&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;{% endfor %}&lt;/P&gt;&lt;P&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&amp;lt;!-- end of blog related section --&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Feb 2020 17:33:10 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-02-26T17:33:10Z</dc:date>
    <item>
      <title>Related blog posts HubL tag</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Related-blog-posts-HubL-tag/m-p/321675#M15530</link>
      <description>&lt;P&gt;When using the r&lt;A href="https://designers.hubspot.com/tutorials/creating-a-related-post-listing" target="_self"&gt;elated blog posts HubL tag&lt;/A&gt; in the blog post template, is it possible to use the 'tags' parameter to display a selection of blog posts that share one or all of the same values as those used by a given blog post the user is viewing? And, can they be displayed in order of most views? What would that look like?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any insights would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 17:35:59 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Related-blog-posts-HubL-tag/m-p/321675#M15530</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-25T17:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: Related blog posts HubL tag</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Related-blog-posts-HubL-tag/m-p/321849#M15536</link>
      <description>&lt;P&gt;Hey&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;The tags filter in related_blog_posts gives posts with the listed tags more relevancy. So posts with each of the tags would definitely have a higher chance of being listed, but there's no certainty that only posts with ALL the listed tags will be the ones shown.&lt;BR /&gt;&lt;BR /&gt;If you want to grab the tags from the current post to add to your related_blog_posts function it would looks something like this :&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;{% set post_tags = content.tagList|join(", ") %}
{% related_blog_posts limit=3, tags="{{ post_tags }}" post_formatter="blog_post_formatter" %}&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;For your question of sorting them by most views--there is no option in the related_blog_posts function to do so (it would certainly be a great addition though and I suggest submitting an idea to the &lt;A href="https://community.hubspot.com/t5/HubSpot-Ideas/idb-p/HubSpot_Ideas" target="_self"&gt;Ideas Forum&lt;/A&gt; for it). I believe only blog_popular_posts has that functionality and it can only be filtered down to a singular tag slug, not multiple.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;{% set post_tag = [] %}
{% for topic in content.topic_list|first %}
  {% set post_tags = post_tag.append(topic.slug) %}
{% endfor %}

{% set pop_posts = blog_popular_posts('default', 3,  post_tag[0]) %}
{% for pop_post in pop_posts %}
    &amp;lt;h2&amp;gt;{{ post_post.name }}&amp;lt;/h2&amp;gt;
{% endfor %}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 02:00:40 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Related-blog-posts-HubL-tag/m-p/321849#M15536</guid>
      <dc:creator>alyssamwilie</dc:creator>
      <dc:date>2020-02-26T02:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: Related blog posts HubL tag</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Related-blog-posts-HubL-tag/m-p/321991#M15545</link>
      <description>&lt;P&gt;Thank you so much for the reply, &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/91608"&gt;@alyssamwilie&lt;/a&gt;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried adding your code to the blog post template code but it won't let me publish it. I'm getting an error. Any ideas as to what the reason could be? Here is a copy of the code and I've marked the related blog posts part in red comments.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;div class="blog-section"&amp;gt;&lt;BR /&gt;&amp;lt;div class="blog-post-wrapper cell-wrapper"&amp;gt;&lt;BR /&gt;&amp;lt;div class="blog-section"&amp;gt;&lt;BR /&gt;&amp;lt;div class="blog-post-wrapper cell-wrapper"&amp;gt;&lt;BR /&gt;&amp;lt;!-- &amp;lt;img src="{{ content.featured_image }}" class="featured-image" /&amp;gt; --&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;div class="share-post"&amp;gt;&lt;BR /&gt;&amp;lt;h3 class="share text-center"&amp;gt;Share:&amp;lt;/h3&amp;gt;&lt;BR /&gt;{% widget_block social_sharing "social_sharing" label='Social Sharing', use_page_url=True, overrideable=False %}&lt;BR /&gt;{% widget_attribute "twitter" is_json=True %}{"link_format": "&lt;A href="https://twitter.com/intent/tweet?original_referer=" target="_blank"&gt;https://twitter.com/intent/tweet?original_referer=&lt;/A&gt;{{ social_link_url }}&amp;amp;url={{ social_link_url }}&amp;amp;source=tweetbutton&amp;amp;text={{ social_page_title }}", "network": "Twitter", "default": true, "enabled": true, "custom_link_format": "", "img_src": "&lt;A href="https://static.hubspot.com/final/img/common/icons/social/twitter-24x24.png" target="_blank"&gt;https://static.hubspot.com/final/img/common/icons/social/twitter-24x24.png&lt;/A&gt;", "custom_link": ""}{% end_widget_attribute %}&lt;BR /&gt;{% widget_attribute "linkedin" is_json=True %}{"link_format": "&lt;A href="http://www.linkedin.com/shareArticle?mini=true&amp;amp;url=" target="_blank"&gt;http://www.linkedin.com/shareArticle?mini=true&amp;amp;url=&lt;/A&gt;{{ social_link_url }}", "network": "LinkedIn", "default": true, "enabled": true, "custom_link_format": "", "img_src": "&lt;A href="https://static.hubspot.com/final/img/common/icons/social/linkedin-24x24.png" target="_blank"&gt;https://static.hubspot.com/final/img/common/icons/social/linkedin-24x24.png&lt;/A&gt;", "custom_link": ""}{% end_widget_attribute %}&lt;BR /&gt;{% widget_attribute "google_plus" is_json=True %}{"link_format": "&lt;A href="https://plus.google.com/share?url=" target="_blank"&gt;https://plus.google.com/share?url=&lt;/A&gt;{{ social_link_url }}", "network": "Google+", "default": true, "enabled": true, "custom_link_format": "", "img_src": "&lt;A href="https://static.hubspot.com/final/img/common/icons/social/googleplus-24x24.png" target="_blank"&gt;https://static.hubspot.com/final/img/common/icons/social/googleplus-24x24.png&lt;/A&gt;", "custom_link": ""}{% end_widget_attribute %}&lt;BR /&gt;{% widget_attribute "facebook" is_json=True %}{"link_format": "&lt;A href="http://www.facebook.com/share.php?u=" target="_blank"&gt;http://www.facebook.com/share.php?u=&lt;/A&gt;{{ social_link_url }}", "network": "Facebook", "default": true, "enabled": true, "custom_link_format": "", "img_src": "&lt;A href="https://static.hubspot.com/final/img/common/icons/social/facebook-24x24.png" target="_blank"&gt;https://static.hubspot.com/final/img/common/icons/social/facebook-24x24.png&lt;/A&gt;", "custom_link": ""}{% end_widget_attribute %}&lt;BR /&gt;{% widget_attribute "email" is_json=True %}{"link_format": "mailto:?subject=Check out {{ social_link_url }} &amp;amp;body=Check out {{ social_link_url }}", "network": "Email", "default": true, "enabled": true, "custom_link_format": "", "img_src": "&lt;A href="https://static.hubspot.com/final/img/common/icons/social/email-24x24.png" target="_blank"&gt;https://static.hubspot.com/final/img/common/icons/social/email-24x24.png&lt;/A&gt;", "custom_link": ""}{% end_widget_attribute %}&lt;BR /&gt;{% end_widget_block %}&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;article class="post-body"&amp;gt;&lt;BR /&gt;{{ content.post_body }}&lt;BR /&gt;&amp;lt;/article&amp;gt;&lt;BR /&gt;&lt;BR /&gt;{% choice "optional_CTA" label="&amp;lt;span style=color:#e8771b;&amp;gt;Do you want to show the optional call-to-action?&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span&amp;gt;Hit Save to refresh the preview.&amp;lt;/span&amp;gt;", choices="No,Yes", export_to_template_context=True %}&lt;BR /&gt;{% text "call_to_action" label="Call to action", export_to_template_context=True %}&lt;BR /&gt;{% cta "cta" label="CTA button", export_to_template_context=True %}&lt;/P&gt;&lt;P&gt;{% if widget_data.optional_CTA.value == "Yes" %}&lt;BR /&gt;&amp;lt;hr&amp;gt;&lt;BR /&gt;&amp;lt;h3 style="text-align: center; font-size: 1.6em; line-height: 1.4em; margin-top: 20px; margin-bottom: 45px;"&amp;gt;{% text "call_to_action" label="Call to action", no_wrapper=True %}&amp;lt;/h3&amp;gt;&lt;BR /&gt;&amp;lt;div style="text-align:center;margin-bottom:1em"&amp;gt;{% cta "cta" label="CTA button", no_wrapper=True %}&amp;lt;/div&amp;gt;&lt;BR /&gt;{% endif %}&lt;BR /&gt;&lt;BR /&gt;&amp;lt;div class="section section-narrow post-pagination no-padding-bottom"&amp;gt;&lt;BR /&gt;{% if content.next_post_slug %}&amp;lt;a href="/{{ content.next_post_slug }}" class="prev-post-link"&amp;gt;Previous Post&amp;lt;/a&amp;gt;{% endif %}&lt;BR /&gt;{% if content.previous_post_slug %}&amp;lt;a href="/{{ content.previous_post_slug }}" class="next-post-link"&amp;gt;Next Post&amp;lt;/a&amp;gt;{% endif %}&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&amp;lt;!-- related blog posts section starts here --&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&amp;lt;div class="row-fluid "&amp;gt;&lt;BR /&gt;&amp;lt;div class="span12 widget-span widget-type-raw_jinja " style="" data-widget-type="raw_jinja" data-x="0" data-w="12"&amp;gt;&lt;BR /&gt;{% set post_tags = content.tagList|join(", ") %}&lt;BR /&gt;{% related_blog_posts limit=3, tags="{{ post_tags }}" post_formatter="blog_post_formatter" %}&lt;/P&gt;&lt;P&gt;{% for post in posts %}&lt;BR /&gt;&amp;lt;div class="span4"&amp;gt;&lt;BR /&gt;&amp;lt;div class="post-card {% for topic in post.topic_list %}{{ topic.slug }}{% if not loop.last %} {% endif %} {% endfor %} bh-ver"&amp;gt;&lt;BR /&gt;&amp;lt;div class="bh-hor"&amp;gt;&lt;BR /&gt;&amp;lt;a href="{{ post.absolute_url }}"&amp;gt;&lt;BR /&gt;&amp;lt;div class="ft-image" style="background: url('{{ post.featured_image }}') center no-repeat;"&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;div class="content"&amp;gt;&lt;BR /&gt;&amp;lt;h5&amp;gt;{{ post.name }}&amp;lt;/h5&amp;gt;&lt;BR /&gt;&amp;lt;p&amp;gt;{{ post.publish_date|datetimeformat('%B %e, %Y') }}&amp;lt;/p&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/a&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;{% endfor %}&lt;/P&gt;&lt;P&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&amp;lt;!-- end of blog related section --&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 17:33:10 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Related-blog-posts-HubL-tag/m-p/321991#M15545</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-26T17:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: Related blog posts HubL tag</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Related-blog-posts-HubL-tag/m-p/322124#M15558</link>
      <description>&lt;P&gt;The related_blog_posts function works a little differently from other blog post listing functions in that it uses a macro to format the posts instead of a for loop.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&amp;lt;!-- related blog posts section starts here --&amp;gt;
&amp;lt;div class="row-fluid "&amp;gt;
    &amp;lt;div class="span12 widget-span widget-type-raw_jinja " style="" data-widget-type="raw_jinja" data-x="0" data-w="12"&amp;gt;
    
     {% macro blog_post_formatter(post) %}
       &amp;lt;div class="span4"&amp;gt;
         &amp;lt;div class="post-card {% for topic in post.topic_list %}{{ topic.slug }}{% if not loop.last %} {% endif %} {% endfor %} bh-ver"&amp;gt;
           &amp;lt;div class="bh-hor"&amp;gt;
             &amp;lt;a href="{{ post.absolute_url }}"&amp;gt;
               &amp;lt;div class="ft-image" style="background: url('{{ post.featured_image }}') center no-repeat;"&amp;gt;
               &amp;lt;/div&amp;gt;
               &amp;lt;div class="content"&amp;gt;
                 &amp;lt;h5&amp;gt;{{ post.name }}&amp;lt;/h5&amp;gt;
                 &amp;lt;p&amp;gt;
                   {{ post.publish_date|datetimeformat('%B %e, %Y') }}
                 &amp;lt;/p&amp;gt;
               &amp;lt;/div&amp;gt;
             &amp;lt;/a&amp;gt;
            &amp;lt;/div&amp;gt;
           &amp;lt;/div&amp;gt;
         &amp;lt;/div&amp;gt;
       {% endmacro %}

       {% set post_tags = content.tagList|join(", ") %}
       {% related_blog_posts limit=3, tags="{{ post_tags }}" post_formatter="blog_post_formatter" %}

&amp;lt;/div&amp;gt;
&amp;lt;!-- end of blog related section --&amp;gt;&lt;/PRE&gt;
&lt;P&gt;You can read more about this function in one of my blog posts -&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.alyssawilie.com/blog/hubl-related-blog-posts" target="_blank" rel="noopener"&gt;https://www.alyssawilie.com/blog/hubl-related-blog-posts&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 17:49:37 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Related-blog-posts-HubL-tag/m-p/322124#M15558</guid>
      <dc:creator>alyssamwilie</dc:creator>
      <dc:date>2022-07-22T17:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: Related blog posts HubL tag</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Related-blog-posts-HubL-tag/m-p/322386#M15569</link>
      <description>&lt;P&gt;Here is latest code for related post, It will not appear current post in current post, I have checked other comment they are using old code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{% if content.topic_list %}&lt;BR /&gt;{% set max_posts = 3 %}&amp;lt;!-- Set the max number of related posts to be output to the page here --&amp;gt;&lt;BR /&gt;{% set post_list = [] %}&lt;BR /&gt;{% for topic in content.topic_list %}&lt;BR /&gt;{% set post_list = post_list + blog_recent_topic_posts(group.id, topic.slug, max_posts + 1 ) %}&lt;BR /&gt;{% if loop.last %}&lt;BR /&gt;{% set post_list = post_list|sort(true, false, 'publish_date')|unique('name') %}&lt;BR /&gt;{% set i = 0 %}&lt;/P&gt;&lt;P&gt;&amp;lt;h2&amp;gt;{{ topic|replace('-',' ') }}&amp;lt;/h2&amp;gt; &amp;lt;!-- It will Show the Topic Name--&amp;gt;&lt;BR /&gt;{% for post in post_list %}&lt;BR /&gt;{% if content.absolute_url != post.absolute_url and i &amp;lt; max_posts %}&lt;BR /&gt;&amp;lt;li&amp;gt;&lt;BR /&gt;&amp;lt;a href="{{post.absolute_url}}"&amp;gt;&lt;BR /&gt;&amp;lt;span class="crp_title"&amp;gt;{{ post.name}}/span&amp;gt;&lt;BR /&gt;&amp;lt;/a&amp;gt;&lt;BR /&gt;&amp;lt;/li&amp;gt;&lt;BR /&gt;{% set i = i + 1 %}&lt;BR /&gt;{% endif %}&lt;BR /&gt;{% endfor %}&lt;BR /&gt;{% endif %}&lt;BR /&gt;{% endfor %}&lt;BR /&gt;&amp;lt;/ul&amp;gt;&lt;BR /&gt;{% endif %}&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 17:18:22 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Related-blog-posts-HubL-tag/m-p/322386#M15569</guid>
      <dc:creator>SSN</dc:creator>
      <dc:date>2020-02-27T17:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: Related blog posts HubL tag</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Related-blog-posts-HubL-tag/m-p/323074#M15610</link>
      <description>&lt;P&gt;I tried out the macro code that&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/91608"&gt;@alyssamwilie&lt;/a&gt;&amp;nbsp;provided and it worked. Thanks a lot! Three related blog posts are displaying at the end of each blog post and they're being matched to the current blog's tags.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you all for your contributions.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 11:54:07 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Related-blog-posts-HubL-tag/m-p/323074#M15610</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-02T11:54:07Z</dc:date>
    </item>
  </channel>
</rss>

