<?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 Blog posts with multiple tags are displaying twice on blog listing page in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Blog-posts-with-multiple-tags-are-displaying-twice-on-blog/m-p/700213#M30661</link>
    <description>&lt;P&gt;Hi all! I am having an issue where any blog posts that have more than one tag will display more than once.&amp;nbsp; Here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{% for content in contents|unique %}
   {% if loop.index &amp;gt; 1  %}
    {% for topic in content.topic_list %}
     {% unless topic.name == 'Expert Forum Insider' %}

       &amp;lt;article class="blog-index__post blog-index__post--large"&amp;gt;
         &amp;lt;a href="{{ content.absolute_url }}"&amp;gt;

         &amp;lt;div class="blog-image-section"&amp;gt;
       {% if content.featured_image and group.use_featured_image_in_summary %}
        &amp;lt;div class="blog-index__post-image blog-index__post-image--large"
   href="{{ content.absolute_url }}"&amp;gt;
&amp;lt;!--                                   &amp;lt;picture&amp;gt;
                                    &amp;lt;source srcset="{{ content.featured_image|replace("jpg", "webp") }}" type="image/webp"&amp;gt;

                                    &amp;lt;source srcset="{{ resize_image_url(content.featured_image, 380, 0, 0) }}" type="image/jpeg"&amp;gt;  --&amp;gt;
                                    &amp;lt;img src="{{ resize_image_url(content.featured_image, 380, 0, 0) }}" alt="{{ content.featured_image_alt_text }}"&amp;gt;
&amp;lt;!--                                   &amp;lt;/picture&amp;gt; --&amp;gt;
                    
                                &amp;lt;/div&amp;gt;
                              {% endif %}
                              {% for topic in content.topic_list %}
                                {% unless topic.name == "featured" or topic.name == "featured-main" %}
                                {% if loop.index &amp;lt; 2 %}
                                &amp;lt;div class="topic-link"&amp;gt;
                                  &amp;lt;span class="topic-style"&amp;gt;{{ topic.name }}&amp;lt;/span&amp;gt;
                                &amp;lt;/div&amp;gt;
                                {% endif %}
                                {% endunless %}
                                {% endfor %}
                            &amp;lt;/div&amp;gt;
                            &amp;lt;div class="blog-content-section"&amp;gt;
                              &amp;lt;div class="blog-index__post-content  blog-index__post-content--large{% if !content.featured_image or !group.use_featured_image_in_summary %} blog-index__post-content--full-width{% endif %}"&amp;gt;
                                
                                &amp;lt;h3 class="blog-title-name"&amp;gt;{{ content.name }}&amp;lt;/h3&amp;gt;
                              &amp;lt;/div&amp;gt;
                            &amp;lt;/div&amp;gt;

               
                    &amp;lt;/a&amp;gt;
                  &amp;lt;/article&amp;gt;
              {% endunless %}
            {% endfor %}
             {% endif %}
            {% endfor %}&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 29 Sep 2022 18:47:29 GMT</pubDate>
    <dc:creator>jwill377</dc:creator>
    <dc:date>2022-09-29T18:47:29Z</dc:date>
    <item>
      <title>Blog posts with multiple tags are displaying twice on blog listing page</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Blog-posts-with-multiple-tags-are-displaying-twice-on-blog/m-p/700213#M30661</link>
      <description>&lt;P&gt;Hi all! I am having an issue where any blog posts that have more than one tag will display more than once.&amp;nbsp; Here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{% for content in contents|unique %}
   {% if loop.index &amp;gt; 1  %}
    {% for topic in content.topic_list %}
     {% unless topic.name == 'Expert Forum Insider' %}

       &amp;lt;article class="blog-index__post blog-index__post--large"&amp;gt;
         &amp;lt;a href="{{ content.absolute_url }}"&amp;gt;

         &amp;lt;div class="blog-image-section"&amp;gt;
       {% if content.featured_image and group.use_featured_image_in_summary %}
        &amp;lt;div class="blog-index__post-image blog-index__post-image--large"
   href="{{ content.absolute_url }}"&amp;gt;
&amp;lt;!--                                   &amp;lt;picture&amp;gt;
                                    &amp;lt;source srcset="{{ content.featured_image|replace("jpg", "webp") }}" type="image/webp"&amp;gt;

                                    &amp;lt;source srcset="{{ resize_image_url(content.featured_image, 380, 0, 0) }}" type="image/jpeg"&amp;gt;  --&amp;gt;
                                    &amp;lt;img src="{{ resize_image_url(content.featured_image, 380, 0, 0) }}" alt="{{ content.featured_image_alt_text }}"&amp;gt;
&amp;lt;!--                                   &amp;lt;/picture&amp;gt; --&amp;gt;
                    
                                &amp;lt;/div&amp;gt;
                              {% endif %}
                              {% for topic in content.topic_list %}
                                {% unless topic.name == "featured" or topic.name == "featured-main" %}
                                {% if loop.index &amp;lt; 2 %}
                                &amp;lt;div class="topic-link"&amp;gt;
                                  &amp;lt;span class="topic-style"&amp;gt;{{ topic.name }}&amp;lt;/span&amp;gt;
                                &amp;lt;/div&amp;gt;
                                {% endif %}
                                {% endunless %}
                                {% endfor %}
                            &amp;lt;/div&amp;gt;
                            &amp;lt;div class="blog-content-section"&amp;gt;
                              &amp;lt;div class="blog-index__post-content  blog-index__post-content--large{% if !content.featured_image or !group.use_featured_image_in_summary %} blog-index__post-content--full-width{% endif %}"&amp;gt;
                                
                                &amp;lt;h3 class="blog-title-name"&amp;gt;{{ content.name }}&amp;lt;/h3&amp;gt;
                              &amp;lt;/div&amp;gt;
                            &amp;lt;/div&amp;gt;

               
                    &amp;lt;/a&amp;gt;
                  &amp;lt;/article&amp;gt;
              {% endunless %}
            {% endfor %}
             {% endif %}
            {% endfor %}&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 29 Sep 2022 18:47:29 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Blog-posts-with-multiple-tags-are-displaying-twice-on-blog/m-p/700213#M30661</guid>
      <dc:creator>jwill377</dc:creator>
      <dc:date>2022-09-29T18:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: Blog posts with multiple tags are displaying twice on blog listing page</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Blog-posts-with-multiple-tags-are-displaying-twice-on-blog/m-p/700227#M30662</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% for content in contents|unique %}
   {% if loop.index &amp;gt; 1  %}
    {% for topic in content.topic_list %}
     {% unless topic.name == 'Expert Forum Insider' %}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could it be that you are looping the topic_list here as well?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your loop here is outputting the HTML once for each topic a content has. So if a content has 2 topics, it'll appear twice.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 19:12:04 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Blog-posts-with-multiple-tags-are-displaying-twice-on-blog/m-p/700227#M30662</guid>
      <dc:creator>LeeBartelme</dc:creator>
      <dc:date>2022-09-29T19:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: Blog posts with multiple tags are displaying twice on blog listing page</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Blog-posts-with-multiple-tags-are-displaying-twice-on-blog/m-p/700246#M30669</link>
      <description>&lt;P&gt;Yeah it was looping through the topic list. I found this as a solution that worked perfectly...&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{% set myString = "Expert Forum Insider" %}
  {% if myString in content.topic_list|map('name') %}
            
    {% else %}&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 29 Sep 2022 19:38:30 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Blog-posts-with-multiple-tags-are-displaying-twice-on-blog/m-p/700246#M30669</guid>
      <dc:creator>jwill377</dc:creator>
      <dc:date>2022-09-29T19:38:30Z</dc:date>
    </item>
  </channel>
</rss>

