<?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: Excluding a blog topic from a Topics list in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Excluding-a-blog-topic-from-a-Topics-list/m-p/201010#M7435</link>
    <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/67320"&gt;@Octo&lt;/a&gt;&amp;nbsp;- The html should actually be smaller if you use the second option I gave you. Also, not quite sure what you mean by the HTML being smaller. HUBL code is ran on the server side and not the client side.&lt;/P&gt;&lt;P&gt;If you're worrying about too much data being pulled into the template, you shouldn't have to worry about that since all the filter does is sanitize the data&amp;nbsp;&lt;STRONG&gt;after&amp;nbsp;&lt;/STRONG&gt;it's available anyway. You can see this by viewing the developer info for the page.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Aug 2018 13:53:05 GMT</pubDate>
    <dc:creator>tjoyce</dc:creator>
    <dc:date>2018-08-07T13:53:05Z</dc:date>
    <item>
      <title>Excluding a blog topic from a Topics list</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Excluding-a-blog-topic-from-a-Topics-list/m-p/200969#M7420</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm&amp;nbsp;creating a template for blog posts listing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One of the topics is for&amp;nbsp;service use only ("Highlight"), I use it to show in&amp;nbsp;&lt;SPAN&gt;particular listing.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to show the first topic for each post but not "Highlight".&lt;/P&gt;&lt;P&gt;So&lt;SPAN&gt; I need to remove this topic from topic list of single post.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried to filter topics with "rejectAttr":&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;// getting topics from post:&lt;BR /&gt;{% for topic in content.topic_list|rejectattr('name', 'string_startingwith "High"')%}&lt;BR /&gt; {% if loop.index &amp;lt;= 1 %}&lt;BR /&gt; &amp;lt;div class="topic"&amp;gt;{{ topic.name }}&amp;lt;/div&amp;gt;&lt;BR /&gt; {% endif %}&lt;BR /&gt;{% endfor %}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it doesn't work at all: I get an empty array after filtering.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Be so kind to tell me how to use rejectattr in this case?&lt;/P&gt;&lt;P&gt;Or is there another way to filter out the topic that I don't want to be in my listing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 07 Aug 2018 09:22:05 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Excluding-a-blog-topic-from-a-Topics-list/m-p/200969#M7420</guid>
      <dc:creator>Octo</dc:creator>
      <dc:date>2018-08-07T09:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: Excluding a blog topic from a Topics list</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Excluding-a-blog-topic-from-a-Topics-list/m-p/200990#M7423</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/67320"&gt;@Octo&lt;/a&gt;&amp;nbsp;- I'm not seeing the&amp;nbsp;&lt;STRONG&gt;string_startswith&amp;nbsp;&lt;/STRONG&gt;filter in the HUBL documentation. Can you confirm that it exists in there with a link?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think you will have better results if you just do a straight string comparison on the rejectattr filter&lt;/P&gt;&lt;PRE&gt;{% for topic in content.topic_list|rejectattr('name', 'Highlight')%}&lt;/PRE&gt;&lt;HR /&gt;&lt;P&gt;If this answer helped, please, mark as solved &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;tim@belch.io | &lt;A href="https://forms.belch.io" target="_blank"&gt;forms.belch.io&lt;/A&gt; | Design your own Beautiful HubSpot Forms; No coding necessary.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Drop by and say Hi to me &lt;A href="http://slack.belch.io/" target="_blank"&gt;on slack&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Aug 2018 12:05:56 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Excluding-a-blog-topic-from-a-Topics-list/m-p/200990#M7423</guid>
      <dc:creator>tjoyce</dc:creator>
      <dc:date>2018-08-07T12:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: Excluding a blog topic from a Topics list</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Excluding-a-blog-topic-from-a-Topics-list/m-p/200998#M7428</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/2450"&gt;@tjoyce&lt;/a&gt;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your reply, but it doesn't works for me &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I got an empty sequence.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;&lt;SPAN&gt;&amp;nbsp;I'm not seeing the&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;string_startswith&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;filter in the HUBL documentation&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Second argument&amp;nbsp;for &lt;STRONG&gt;rejectattr&lt;/STRONG&gt; is expression test, so I found&amp;nbsp;&lt;STRONG&gt;string_startswith&amp;nbsp;&lt;/STRONG&gt;in expression tests list:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://designers.hubspot.com/docs/hubl/operators-and-expression-tests" target="_blank"&gt;https://designers.hubspot.com/docs/hubl/operators-and-expression-tests&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Aug 2018 13:01:27 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Excluding-a-blog-topic-from-a-Topics-list/m-p/200998#M7428</guid>
      <dc:creator>Octo</dc:creator>
      <dc:date>2018-08-07T13:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: Excluding a blog topic from a Topics list</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Excluding-a-blog-topic-from-a-Topics-list/m-p/201002#M7430</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/67320"&gt;@Octo&lt;/a&gt;&amp;nbsp;- I see... I don't think you can chain an expression test to a filter in a loop since the loop hasn't returned the string yet and you can't access the dict child of name in the topic. I think this might be a better approach (maybe less elegant though)&lt;/P&gt;&lt;PRE&gt;{% for topic in content.topic_list %}
   {% if !topic.name is string_startingwith "High" %}
       &amp;lt;div class="topic"&amp;gt;{{ topic|pprint }}&amp;lt;/div&amp;gt;
   {% endif %}
{% endfor %}&lt;/PRE&gt;&lt;P&gt;Or, slightly more elegant...&lt;/P&gt;&lt;PRE&gt;{% for topic in content.topic_list %}&lt;BR /&gt; {{ '&amp;lt;div class="topic"&amp;gt;'+topic.name+'&amp;lt;/div&amp;gt;' if !topic.name is string_startingwith "High" }}&lt;BR /&gt;{% endfor %}&amp;nbsp;&lt;/PRE&gt;&lt;HR /&gt;&lt;P&gt;If this answer helped, please, mark as solved &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;tim@belch.io | &lt;A href="https://forms.belch.io" target="_blank"&gt;forms.belch.io&lt;/A&gt; | Design your own Beautiful HubSpot Forms; No coding necessary.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Drop by and say Hi to me &lt;A href="http://slack.belch.io/" target="_blank"&gt;on slack&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Aug 2018 13:37:54 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Excluding-a-blog-topic-from-a-Topics-list/m-p/201002#M7430</guid>
      <dc:creator>tjoyce</dc:creator>
      <dc:date>2018-08-07T13:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: Excluding a blog topic from a Topics list</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Excluding-a-blog-topic-from-a-Topics-list/m-p/201009#M7434</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/2450"&gt;@tjoyce&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help!&lt;/P&gt;&lt;P&gt;This will work, but I'll have to hide all&amp;nbsp;the following topics except the first. Also, this will increase the HTML a bit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll wait for a while. maybe&amp;nbsp;someone will help&amp;nbsp;with a&amp;nbsp;solution to filter the&amp;nbsp;data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Aug 2018 13:43:26 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Excluding-a-blog-topic-from-a-Topics-list/m-p/201009#M7434</guid>
      <dc:creator>Octo</dc:creator>
      <dc:date>2018-08-07T13:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: Excluding a blog topic from a Topics list</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Excluding-a-blog-topic-from-a-Topics-list/m-p/201010#M7435</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/67320"&gt;@Octo&lt;/a&gt;&amp;nbsp;- The html should actually be smaller if you use the second option I gave you. Also, not quite sure what you mean by the HTML being smaller. HUBL code is ran on the server side and not the client side.&lt;/P&gt;&lt;P&gt;If you're worrying about too much data being pulled into the template, you shouldn't have to worry about that since all the filter does is sanitize the data&amp;nbsp;&lt;STRONG&gt;after&amp;nbsp;&lt;/STRONG&gt;it's available anyway. You can see this by viewing the developer info for the page.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Aug 2018 13:53:05 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Excluding-a-blog-topic-from-a-Topics-list/m-p/201010#M7435</guid>
      <dc:creator>tjoyce</dc:creator>
      <dc:date>2018-08-07T13:53:05Z</dc:date>
    </item>
  </channel>
</rss>

