<?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: Displaying the Month &amp;amp; Year on an Archive Page in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Displaying-the-Month-amp-Year-on-an-Archive-Page/m-p/1030351#M40380</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/762422"&gt;@fair&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could try extracting the date information from the URL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{% if archive_list_page %}
  {% set archive_params = request.path|split('archive')|last %}
  {% set archive_parts = archive_params|split('/') %}

  {% if archive_parts|length &amp;gt; 1 %}
     {% set months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] %} 
     {{ months[ archive_parts[1] - 1]  ~ " " ~archive_parts[0] }}
  {% else %}
     {{ archive_parts[0] }}
  {% endif %}
{% endif %}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This would work for when you have filtered by months and years as well as just years.&lt;/P&gt;&lt;P&gt;I tried to use date formatting but it kept throwing an error when trying to create a date string from the url parts, so had to resort to creating an array of months and matching the index.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Karla&lt;/P&gt;</description>
    <pubDate>Wed, 21 Aug 2024 16:37:26 GMT</pubDate>
    <dc:creator>KBarnes_Breck</dc:creator>
    <dc:date>2024-08-21T16:37:26Z</dc:date>
    <item>
      <title>Displaying the Month &amp; Year on an Archive Page</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Displaying-the-Month-amp-Year-on-an-Archive-Page/m-p/1024873#M40230</link>
      <description>&lt;P&gt;I surely cannot be the only person that wants to do this, but I have not been able to find any solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a blog listing page with two filter dropdowns: Archive &amp;amp; Topics (Tags). Both work great, and filter the posts appropriately. I am using a modified version of the post_filter module.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a custom module to display my heading with some logic to change the heading based on certain criteria. After smacking my head around a bit I did manage to get the heading for my Topics (Tags) to display, but I'm not sure how to tackle the Archive.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-08-09 at 1.05.22 PM.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/124423i30CD8D4EBAABF03D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-08-09 at 1.05.22 PM.png" alt="Screenshot 2024-08-09 at 1.05.22 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My if/else statement in my custom module looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    {% if topic %}
      {{ page_meta.html_title|split(' | ')|last }}
    {% else %}
      {{ module.value }}
    {% endif %}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like for my archive page to have a heading like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;June 2024&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are there any tags I can use for this or do I need some other method? I can't use the page title like I did for the topics, but perhaps the URL can be used? the problem is I have no idea how to actually set this up or how to even start.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 18:26:35 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Displaying-the-Month-amp-Year-on-an-Archive-Page/m-p/1024873#M40230</guid>
      <dc:creator>fair</dc:creator>
      <dc:date>2024-08-09T18:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying the Month &amp; Year on an Archive Page</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Displaying-the-Month-amp-Year-on-an-Archive-Page/m-p/1025798#M40256</link>
      <description>&lt;P&gt;Hey, &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/762422"&gt;@fair&lt;/a&gt;&lt;/SPAN&gt; &lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; Did you make any progress on this project? — Jaycee&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2024 15:39:28 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Displaying-the-Month-amp-Year-on-an-Archive-Page/m-p/1025798#M40256</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2024-08-12T15:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying the Month &amp; Year on an Archive Page</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Displaying-the-Month-amp-Year-on-an-Archive-Page/m-p/1025840#M40258</link>
      <description>&lt;P&gt;Nothing yet. I may just make my own archive pages manually if I can get a blog feed to show just a specific time range.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2024 16:39:20 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Displaying-the-Month-amp-Year-on-an-Archive-Page/m-p/1025840#M40258</guid>
      <dc:creator>fair</dc:creator>
      <dc:date>2024-08-12T16:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying the Month &amp; Year on an Archive Page</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Displaying-the-Month-amp-Year-on-an-Archive-Page/m-p/1030351#M40380</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/762422"&gt;@fair&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could try extracting the date information from the URL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{% if archive_list_page %}
  {% set archive_params = request.path|split('archive')|last %}
  {% set archive_parts = archive_params|split('/') %}

  {% if archive_parts|length &amp;gt; 1 %}
     {% set months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] %} 
     {{ months[ archive_parts[1] - 1]  ~ " " ~archive_parts[0] }}
  {% else %}
     {{ archive_parts[0] }}
  {% endif %}
{% endif %}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This would work for when you have filtered by months and years as well as just years.&lt;/P&gt;&lt;P&gt;I tried to use date formatting but it kept throwing an error when trying to create a date string from the url parts, so had to resort to creating an array of months and matching the index.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Karla&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2024 16:37:26 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Displaying-the-Month-amp-Year-on-an-Archive-Page/m-p/1030351#M40380</guid>
      <dc:creator>KBarnes_Breck</dc:creator>
      <dc:date>2024-08-21T16:37:26Z</dc:date>
    </item>
  </channel>
</rss>

