<?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: Sort blog listing based on custom module field in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Sort-blog-listing-based-on-custom-module-field/m-p/204729#M8000</link>
    <description>&lt;P&gt;This HubDB solution is very helpful. It feels a bit&amp;nbsp;unnecessary to have to add the events in more than one place, but seems like a pretty quick and straight forward solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 31 Aug 2018 13:38:35 GMT</pubDate>
    <dc:creator>hannalofving</dc:creator>
    <dc:date>2018-08-31T13:38:35Z</dc:date>
    <item>
      <title>Sort blog listing based on custom module field</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Sort-blog-listing-based-on-custom-module-field/m-p/204509#M7986</link>
      <description>&lt;P&gt;We use a blog to present and list our company events. I would like the listing to be sorted according to the date of the event. The date is saved in a custom module text field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to access the text field from the sort function in the foor loop?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Like this: {% for content in contents|sort(False, False, widgets.event_date.body.value) %}&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 09:42:06 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Sort-blog-listing-based-on-custom-module-field/m-p/204509#M7986</guid>
      <dc:creator>hannalofving</dc:creator>
      <dc:date>2018-08-30T09:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: Sort blog listing based on custom module field</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Sort-blog-listing-based-on-custom-module-field/m-p/204724#M7999</link>
      <description>&lt;P&gt;Hi there!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not sure if others on the community might have&amp;nbsp;other thoughts but I don't believe you can sort blog listings by a custom module text field. The &lt;A href="https://designers.hubspot.com/docs/hubl/blog-content-markup" target="_self"&gt;markup &lt;/A&gt;loops through "contents" which are the posts:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{% for content in contents %}
    &amp;lt;div class="post-item"&amp;gt;
        Post item markup that renders with each iteration.              
    &amp;lt;/div&amp;gt;
{% endfor %}       &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And there are &lt;A href="https://designers.hubspot.com/docs/hubl/hubl-supported-variables" target="_self"&gt;set blog variables&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Perhaps you could do something such as set topics with the date ('Event Date 2018-09-21', 'Event Date 2018-10-22') and then filter by topics with "Event Date" and sort alphabetically?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{% for content in contents %}
   {% for topic in content.topic_list %}
     {% if "Event Date" in topic.name %}
        {% topic.name|sort(False, False, 'name') %}     

           {# Add your post markup here #}

     {% endif %}
   {% endfor %}
{% endfor %}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(I haven't tested this code, I'm just combining &lt;A href="http://www.stephanieogaygarcia.com/blog/set-featured-blog-posts-on-the-hubspot-blog-listings-page?utm_source=HubSpotCommunity" target="_self"&gt;looping through a topic&lt;/A&gt; and &lt;A href="https://designers.hubspot.com/docs/hubl/hubl-supported-filters" target="_self"&gt;sort&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've noticed&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/3688"&gt;@Jsum&lt;/a&gt;&amp;nbsp;is great at this type of blog HubL wizardry so he might have a better idea &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another more common way of listing events in HubSpot would be to use HubDB. &lt;A href="https://www.smartbugmedia.com/blog/creating-event-listing-using-hubdb" target="_self"&gt;Here&lt;/A&gt; is a tutorial on how to do so.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope that helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;A href="http://www.stephanieogaygarcia.com?utm_source=HubSpotCommunity" target="_blank"&gt;&lt;IMG src="https://cdn2.hubspot.net/hubfs/1951013/Logos/stephanieogaygarcialogo_black.png" border="0" alt="Stephanie O'Gay Garcia" width="300" /&gt;&lt;/A&gt;HubSpot Design / Development / Automation&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.stephanieogaygarcia.com?utm_source=HubSpotCommunity" target="_blank"&gt;Website&lt;/A&gt; | &lt;A href="http://www.stephanieogaygarcia.com/contact?utm_source=HubSpotCommunity" target="_blank"&gt;Contact&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#32C43F"&gt;&lt;I&gt;If this helped, please mark it as the solution to your question, thanks!&lt;/I&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 12:40:34 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Sort-blog-listing-based-on-custom-module-field/m-p/204724#M7999</guid>
      <dc:creator>Stephanie-OG</dc:creator>
      <dc:date>2018-08-31T12:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: Sort blog listing based on custom module field</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Sort-blog-listing-based-on-custom-module-field/m-p/204729#M8000</link>
      <description>&lt;P&gt;This HubDB solution is very helpful. It feels a bit&amp;nbsp;unnecessary to have to add the events in more than one place, but seems like a pretty quick and straight forward solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 13:38:35 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Sort-blog-listing-based-on-custom-module-field/m-p/204729#M8000</guid>
      <dc:creator>hannalofving</dc:creator>
      <dc:date>2018-08-31T13:38:35Z</dc:date>
    </item>
  </channel>
</rss>

