<?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: Blog tags not showing on individual list items on the search results listing. in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Blog-tags-not-showing-on-individual-list-items-on-the-search/m-p/377543#M19047</link>
    <description>&lt;P&gt;Thanks for this Stefen, I'm now getting an error of Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node' in the console. No results are showing.&lt;/P&gt;</description>
    <pubDate>Fri, 09 Oct 2020 07:07:39 GMT</pubDate>
    <dc:creator>ScottD22</dc:creator>
    <dc:date>2020-10-09T07:07:39Z</dc:date>
    <item>
      <title>Blog tags not showing on individual list items on the search results listing.</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Blog-tags-not-showing-on-individual-list-items-on-the-search/m-p/376712#M18969</link>
      <description>&lt;P&gt;I'm looking for some help to get blog tags added to my individual search results items. Just like in the blog listing template we can add the topics/tags, I need to replicate the samen the search results page. How can I do this?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 14:15:20 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Blog-tags-not-showing-on-individual-list-items-on-the-search/m-p/376712#M18969</guid>
      <dc:creator>ScottD22</dc:creator>
      <dc:date>2020-10-06T14:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: Blog tags not showing on individual list items on the search results listing.</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Blog-tags-not-showing-on-individual-list-items-on-the-search/m-p/377123#M18996</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/147643"&gt;@ScottD22&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;
&lt;P&gt;Great question.&amp;nbsp; If you look at the &lt;A href="https://legacydocs.hubspot.com/docs/methods/content/search-for-content?_ga=2.105293379.1144375483.1601907084-342111340.1595532887" target="_self"&gt;API doc for search&lt;/A&gt;, you will see a property called "tags".&amp;nbsp; This is what you will want to target.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know this fellow&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/133"&gt;@stefen&lt;/a&gt;&amp;nbsp;who is pretty good with building out things like this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/133"&gt;@stefen&lt;/a&gt;&amp;nbsp;, now that I have teed this up for you, could you show&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/147643"&gt;@ScottD22&lt;/a&gt;&amp;nbsp;how you would build this out?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2020 17:52:45 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Blog-tags-not-showing-on-individual-list-items-on-the-search/m-p/377123#M18996</guid>
      <dc:creator>dennisedson</dc:creator>
      <dc:date>2020-10-07T17:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: Blog tags not showing on individual list items on the search results listing.</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Blog-tags-not-showing-on-individual-list-items-on-the-search/m-p/377163#M18999</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/147643"&gt;@ScottD22&lt;/a&gt;&amp;nbsp;like&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/13982"&gt;@dennisedson&lt;/a&gt;&amp;nbsp;is saying, you can loop through the tags on your results page/module inside of your results loop. What I would probably do is first create a new array from all the blog post results, then add all the tags to that new array from each blog post, then de-dupe it, and finally print those tags to the page.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So in Javascript that would look something like this:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;// create new array
var allRelevantTags = [];

// loop through all blog posts
results.forEach(function(result, index){
  // grab the blog post tags and add them to our tags array
  allRelevantTags.push.apply(allRelevantTags, result.tags)
}

// remove duplicate tags
var uniqueRelevantTags = [...new Set(allRelevantTags)];

// print each tag to page
uniqueRelevantTags.forEach(item, index) {
  document.body.appendChild(item);
}&lt;/LI-CODE&gt;
&lt;P&gt;Hope that helps!&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2020 20:30:07 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Blog-tags-not-showing-on-individual-list-items-on-the-search/m-p/377163#M18999</guid>
      <dc:creator>stefen</dc:creator>
      <dc:date>2020-10-07T20:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: Blog tags not showing on individual list items on the search results listing.</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Blog-tags-not-showing-on-individual-list-items-on-the-search/m-p/377168#M19001</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/147643"&gt;@ScottD22&lt;/a&gt;&amp;nbsp;My solution is really for showing&amp;nbsp; all the tags outside of the posts. If you need to show the tags on each post/result it would be much easier. Basically, inside your loop where you are already looping through the results, add another loop to loop through the tags array. If you can show us the code you're using for your results I can be a better help. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2020 20:36:29 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Blog-tags-not-showing-on-individual-list-items-on-the-search/m-p/377168#M19001</guid>
      <dc:creator>stefen</dc:creator>
      <dc:date>2020-10-07T20:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Blog tags not showing on individual list items on the search results listing.</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Blog-tags-not-showing-on-individual-list-items-on-the-search/m-p/377256#M19014</link>
      <description>&lt;P&gt;Hey Stefen,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We just cloned the HS search results module in design tools. We want to show&amp;nbsp;&lt;SPAN&gt;tags on each post/result. Just like you do on the blog listing template.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var hsResultsPage = function(_resultsClass) {
  function buildResultsPage(_instance) {
    var resultTemplate = _instance.querySelector(
        '.hs-search-results__template'
      ),
      resultsSection = _instance.querySelector('.hs-search-results__listing'),
      searchPath = _instance
        .querySelector('.hs-search-results__pagination')
        .getAttribute('data-search-path'),
      prevLink = _instance.querySelector('.hs-search-results__prev-page'),
      nextLink = _instance.querySelector('.hs-search-results__next-page');

    var searchParams = new URLSearchParams(window.location.search.slice(1));

    function getTerm() {
      return searchParams.get('term') || '';
    }
    function getOffset() {
      return parseInt(searchParams.get('offset')) || 0;
    }
    function getLimit() {
      return parseInt(searchParams.get('limit'));
    }
    function addResult(title, url, description, featuredImage) {
      var newResult = document.importNode(resultTemplate.content, true);
      function isFeaturedImageEnabled() {
        if (
          newResult.querySelector('.hs-search-results__featured-image &amp;gt; img')
        ) {
          return true;
        }
      }
      newResult.querySelector('.hs-search-results__title').innerHTML = title;
      newResult.querySelector('.hs-search-results__title').href = url;
      newResult.querySelector(
        '.hs-search-results__description'
      ).innerHTML = description;
      if (typeof featuredImage !== 'undefined' &amp;amp;&amp;amp; isFeaturedImageEnabled()) {
        newResult.querySelector(
          '.hs-search-results__featured-image &amp;gt; img'
        ).src=featuredImage;
      }
      resultsSection.appendChild(newResult);
    }
    function fillResults(results) {
      results.results.forEach(function(result, i) {
        addResult(
          result.title,
          result.url,
          result.description,
          result.featuredImageUrl
        );
      });
    }
    function emptyPagination() {
      prevLink.innerHTML = '';
      nextLink.innerHTML = '';
    }
    function emptyResults(searchedTerm) {
      resultsSection.innerHTML =
        '&amp;lt;div class="hs-search__no-results"&amp;gt;&amp;lt;p&amp;gt;Sorry. There are no results for "' +
        searchedTerm +
        '"&amp;lt;/p&amp;gt;' +
        '&amp;lt;p&amp;gt;Try rewording your query, or browse through our site.&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;';
    }
    function setSearchBarDefault(searchedTerm) {
      var searchBars = document.querySelectorAll('.hs-search-field__input');
      Array.prototype.forEach.call(searchBars, function(el) {
        el.value = searchedTerm;
      });
    }
    function httpRequest(term, offset) {
      var SEARCH_URL = '/_hcms/search?',
        requestUrl = SEARCH_URL + searchParams + '&amp;amp;analytics=true',
        request = new XMLHttpRequest();

      request.open('GET', requestUrl, true);
      request.onload = function() {
        if (request.status &amp;gt;= 200 &amp;amp;&amp;amp; request.status &amp;lt; 400) {
          var data = JSON.parse(request.responseText);
          setSearchBarDefault(data.searchTerm);
          if (data.total &amp;gt; 0) {
            fillResults(data);
            paginate(data);
          } else {
            emptyResults(data.searchTerm);
            emptyPagination();
          }
        } else {
          console.error('Server reached, error retrieving results.');
        }
      };
      request.onerror = function() {
        console.error('Could not reach the server.');
      };
      request.send();
    }
    function paginate(results) {
      var updatedLimit = getLimit() || results.limit;

      function hasPreviousPage() {
        return results.page &amp;gt; 0;
      }
      function hasNextPage() {
        return results.offset &amp;lt;= results.total - updatedLimit;
      }

      if (hasPreviousPage()) {
        var prevParams = new URLSearchParams(searchParams.toString());
        prevParams.set(
          'offset',
          results.page * updatedLimit - parseInt(updatedLimit)
        );
        prevLink.href = '/' + searchPath + '?' + prevParams;
        prevLink.innerHTML = '&amp;amp;lt; Previous page';
      } else {
        prevLink.parentNode.removeChild(prevLink);
      }

      if (hasNextPage()) {
        var nextParams = new URLSearchParams(searchParams.toString());
        nextParams.set(
          'offset',
          results.page * updatedLimit + parseInt(updatedLimit)
        );
        nextLink.href = '/' + searchPath + '?' + nextParams;
        nextLink.innerHTML = 'Next page &amp;amp;gt;';
      } else {
        nextLink.parentNode.removeChild(nextLink);
      }
    }
    var getResults = (function() {
      if (getTerm()) {
        httpRequest(getTerm(), getOffset());
      } else {
        emptyPagination();
      }
    })();
  }
  (function() {
    var searchResults = document.querySelectorAll(_resultsClass);
    Array.prototype.forEach.call(searchResults, function(el) {
      buildResultsPage(el);
    });
  })();
};

if (
  document.attachEvent
    ? document.readyState === 'complete'
    : document.readyState !== 'loading'
) {
  var resultsPages = hsResultsPage('div.hs-search-results');
} else {
  document.addEventListener('DOMContentLoaded', function() {
    var resultsPages = hsResultsPage('div.hs-search-results');
  });
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 08:12:25 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Blog-tags-not-showing-on-individual-list-items-on-the-search/m-p/377256#M19014</guid>
      <dc:creator>ScottD22</dc:creator>
      <dc:date>2020-10-08T08:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: Blog tags not showing on individual list items on the search results listing.</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Blog-tags-not-showing-on-individual-list-items-on-the-search/m-p/377281#M19017</link>
      <description>&lt;P&gt;Hey Stefen,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have just cloned the search results from HubSpot in design tools. So the code if the default JS provided there. We want to&amp;nbsp;&lt;SPAN&gt;show the tags on each post/result&amp;nbsp;.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 09:07:01 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Blog-tags-not-showing-on-individual-list-items-on-the-search/m-p/377281#M19017</guid>
      <dc:creator>ScottD22</dc:creator>
      <dc:date>2020-10-08T09:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: Blog tags not showing on individual list items on the search results listing.</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Blog-tags-not-showing-on-individual-list-items-on-the-search/m-p/377286#M19018</link>
      <description>&lt;LI-CODE lang="php"&gt;var hsResultsPage = function(_resultsClass) {
  function buildResultsPage(_instance) {
    var resultTemplate = _instance.querySelector(
        '.hs-search-results__template'
      ),
      resultsSection = _instance.querySelector('.hs-search-results__listing'),
      searchPath = _instance
        .querySelector('.hs-search-results__pagination')
        .getAttribute('data-search-path'),
      prevLink = _instance.querySelector('.hs-search-results__prev-page'),
      nextLink = _instance.querySelector('.hs-search-results__next-page');

    var searchParams = new URLSearchParams(window.location.search.slice(1));

    function getTerm() {
      return searchParams.get('term') || '';
    }
    function getOffset() {
      return parseInt(searchParams.get('offset')) || 0;
    }
    function getLimit() {
      return parseInt(searchParams.get('limit'));
    }
    function addResult(title, url, description, featuredImage) {
      var newResult = document.importNode(resultTemplate.content, true);
      function isFeaturedImageEnabled() {
        if (
          newResult.querySelector('.hs-search-results__featured-image &amp;gt; img')
        ) {
          return true;
        }
      }
      newResult.querySelector('.hs-search-results__title').innerHTML = title;
      newResult.querySelector('.hs-search-results__title').href = url;
      newResult.querySelector(
        '.hs-search-results__description'
      ).innerHTML = description;
      if (typeof featuredImage !== 'undefined' &amp;amp;&amp;amp; isFeaturedImageEnabled()) {
        newResult.querySelector(
          '.hs-search-results__featured-image &amp;gt; img'
        ).src=featuredImage;
      }
      resultsSection.appendChild(newResult);
    }
    function fillResults(results) {
      results.results.forEach(function(result, i) {
        addResult(
          result.title,
          result.url,
          result.description,
          result.featuredImageUrl
        );
      });
    }
    function emptyPagination() {
      prevLink.innerHTML = '';
      nextLink.innerHTML = '';
    }
    function emptyResults(searchedTerm) {
      resultsSection.innerHTML =
        '&amp;lt;div class="hs-search__no-results"&amp;gt;&amp;lt;p&amp;gt;Sorry. There are no results for "' +
        searchedTerm +
        '"&amp;lt;/p&amp;gt;' +
        '&amp;lt;p&amp;gt;Try rewording your query, or browse through our site.&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;';
    }
    function setSearchBarDefault(searchedTerm) {
      var searchBars = document.querySelectorAll('.hs-search-field__input');
      Array.prototype.forEach.call(searchBars, function(el) {
        el.value = searchedTerm;
      });
    }
    function httpRequest(term, offset) {
      var SEARCH_URL = '/_hcms/search?',
        requestUrl = SEARCH_URL + searchParams + '&amp;amp;analytics=true',
        request = new XMLHttpRequest();

      request.open('GET', requestUrl, true);
      request.onload = function() {
        if (request.status &amp;gt;= 200 &amp;amp;&amp;amp; request.status &amp;lt; 400) {
          var data = JSON.parse(request.responseText);
          setSearchBarDefault(data.searchTerm);
          if (data.total &amp;gt; 0) {
            fillResults(data);
            paginate(data);
          } else {
            emptyResults(data.searchTerm);
            emptyPagination();
          }
        } else {
          console.error('Server reached, error retrieving results.');
        }
      };
      request.onerror = function() {
        console.error('Could not reach the server.');
      };
      request.send();
    }
    function paginate(results) {
      var updatedLimit = getLimit() || results.limit;

      function hasPreviousPage() {
        return results.page &amp;gt; 0;
      }
      function hasNextPage() {
        return results.offset &amp;lt;= results.total - updatedLimit;
      }

      if (hasPreviousPage()) {
        var prevParams = new URLSearchParams(searchParams.toString());
        prevParams.set(
          'offset',
          results.page * updatedLimit - parseInt(updatedLimit)
        );
        prevLink.href = '/' + searchPath + '?' + prevParams;
        prevLink.innerHTML = '&amp;amp;lt; Previous page';
      } else {
        prevLink.parentNode.removeChild(prevLink);
      }

      if (hasNextPage()) {
        var nextParams = new URLSearchParams(searchParams.toString());
        nextParams.set(
          'offset',
          results.page * updatedLimit + parseInt(updatedLimit)
        );
        nextLink.href = '/' + searchPath + '?' + nextParams;
        nextLink.innerHTML = 'Next page &amp;amp;gt;';
      } else {
        nextLink.parentNode.removeChild(nextLink);
      }
    }
    var getResults = (function() {
      if (getTerm()) {
        httpRequest(getTerm(), getOffset());
      } else {
        emptyPagination();
      }
    })();
  }
  (function() {
    var searchResults = document.querySelectorAll(_resultsClass);
    Array.prototype.forEach.call(searchResults, function(el) {
      buildResultsPage(el);
    });
  })();
};

if (
  document.attachEvent
    ? document.readyState === 'complete'
    : document.readyState !== 'loading'
) {
  var resultsPages = hsResultsPage('div.hs-search-results');
} else {
  document.addEventListener('DOMContentLoaded', function() {
    var resultsPages = hsResultsPage('div.hs-search-results');
  });
}&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 08 Oct 2020 09:25:08 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Blog-tags-not-showing-on-individual-list-items-on-the-search/m-p/377286#M19018</guid>
      <dc:creator>ScottD22</dc:creator>
      <dc:date>2020-10-08T09:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: Blog tags not showing on individual list items on the search results listing.</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Blog-tags-not-showing-on-individual-list-items-on-the-search/m-p/377459#M19038</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/147643"&gt;@ScottD22&lt;/a&gt;&amp;nbsp;great! Here's the couple spots you should change:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, in the HTML add a new paragraph to store the tags:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;      &amp;lt;a href="#" class="hs-search-results__title"&amp;gt;Content Title&amp;lt;/a&amp;gt;
      &amp;lt;p class="hs-search-results__description"&amp;gt;Description&amp;lt;/p&amp;gt;
      &amp;lt;p class="hs-search-results__tags"&amp;gt;&amp;lt;/p&amp;gt;
&lt;/LI-CODE&gt;
&lt;P&gt;Then, in the javascript, add the tags to the addResult function:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;function addResult(title, url, description, featuredImage, tags) {
      var newResult = document.importNode(resultTemplate.content, true);
      function isFeaturedImageEnabled() {
        if (
          newResult.querySelector('.hs-search-results__featured-image &amp;gt; img')
        ) {
          return true;
        }
      }
      newResult.querySelector('.hs-search-results__title').innerHTML = title;
      newResult.querySelector('.hs-search-results__title').href = url;
      newResult.querySelector(
        '.hs-search-results__description'
      ).innerHTML = description;
      if (typeof featuredImage !== 'undefined' &amp;amp;&amp;amp; isFeaturedImageEnabled()) {
        newResult.querySelector(
          '.hs-search-results__featured-image &amp;gt; img'
        ).src=featuredImage;
      }
		if(tags) {
			tags.forEach(function(item,i){
				newResult.querySelector('.hs_search-results__tags').appendChild(item);
			});
		}
      resultsSection.appendChild(newResult);
    }&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;Finally, in the javascript update the fillResults function with the tags:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;function fillResults(results) {
      results.results.forEach(function(result, i) {
        addResult(
          result.title,
          result.url,
          result.description,
          result.featuredImageUrl,
		  result.tags
        );
      });
    }&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if that works!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 20:05:44 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Blog-tags-not-showing-on-individual-list-items-on-the-search/m-p/377459#M19038</guid>
      <dc:creator>stefen</dc:creator>
      <dc:date>2020-10-08T20:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: Blog tags not showing on individual list items on the search results listing.</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Blog-tags-not-showing-on-individual-list-items-on-the-search/m-p/377543#M19047</link>
      <description>&lt;P&gt;Thanks for this Stefen, I'm now getting an error of Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node' in the console. No results are showing.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Oct 2020 07:07:39 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Blog-tags-not-showing-on-individual-list-items-on-the-search/m-p/377543#M19047</guid>
      <dc:creator>ScottD22</dc:creator>
      <dc:date>2020-10-09T07:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: Blog tags not showing on individual list items on the search results listing.</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Blog-tags-not-showing-on-individual-list-items-on-the-search/m-p/377985#M19073</link>
      <description>&lt;LI-CODE lang="javascript"&gt;if (tags) {
                tags.forEach(function(item,i){
                    newResult.querySelector('.hs-search-results__tags').innerHTML = tags;
                });
            }&lt;/LI-CODE&gt;&lt;P&gt;Hey guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've managed to fix the issuses I was having, this was my solution thanks to Stefen and a little playing around.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;p class="hs-search-results__tags"&amp;gt;&amp;lt;/p&amp;gt;&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;function addResult(title, url, description, featuredImage, tags) {
            var newResult = document.importNode(resultTemplate.content, true);
            function isFeaturedImageEnabled() {
                if (
                    newResult.querySelector('.hs-search-results__featured-image &amp;gt; img')
                ) {
                    return true;
                }
            }
            newResult.querySelector('.hs-search-results__title').innerHTML = title;
            newResult.querySelector('.hs-search-results__title').href = url;
            newResult.querySelector(
                '.hs-search-results__description'
            ).innerHTML = description;
            if (typeof featuredImage !== 'undefined' &amp;amp;&amp;amp; isFeaturedImageEnabled()) {
                newResult.querySelector(
                    '.hs-search-results__featured-image &amp;gt; img'
                ).src=featuredImage;
            }
            if (tags) {
                tags.forEach(function(item,i){
                    newResult.querySelector('.hs-search-results__tags').innerHTML = tags;
                });
            }
            resultsSection.appendChild(newResult);
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;As you can see&amp;nbsp; I amended the code provided with this and it works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2020 10:30:27 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Blog-tags-not-showing-on-individual-list-items-on-the-search/m-p/377985#M19073</guid>
      <dc:creator>ScottD22</dc:creator>
      <dc:date>2020-10-12T10:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: Blog tags not showing on individual list items on the search results listing.</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Blog-tags-not-showing-on-individual-list-items-on-the-search/m-p/927904#M38011</link>
      <description>&lt;P&gt;The code works perfectly but did you know how to create each tag with link? Cause this print all tags like a sentence.&lt;BR /&gt;&lt;BR /&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 04:10:13 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Blog-tags-not-showing-on-individual-list-items-on-the-search/m-p/927904#M38011</guid>
      <dc:creator>MarinaTakahasi</dc:creator>
      <dc:date>2024-02-23T04:10:13Z</dc:date>
    </item>
  </channel>
</rss>

