Show "month" in blog listing

AF23
Participant | Diamond Partner

Is there any way to show the month before displaying all posts of that specific month?

I am trying to make an "Events" page that shows a cronological list of all events, and i'm trying to display in this way:

 

MONTH #1
Post #1 - Post #2 - Post #3 - Post #4 - Post #5 - etc... 

MONTH #2
Post #6 - Post #7 - Post #8 - Post #9 - etc... 

 

and so on...

0 Upvotes
3 Replies 3
valerajoey
Participant | Diamond Partner

i guess you can group your blog post by publish date post.
{% for group in contents|groupby('blog_post_author') %} // change this to  publish_date filtered by month
<li>{{ group.grouper }}
      <ul> {% for content in group.list %}
      <li>{{ content.name }}</li>
      {% endfor %}</ul>
</li>
{% endfor %}



 

0 Upvotes
AF23
Participant | Diamond Partner

mmm nope... publish date makes no sense.. Event page shows events in the "future".

0 Upvotes
valerajoey
Participant | Diamond Partner

If your using a custom field  ex: 

{% text "Month" label="month" %}

you can try to group it  by widget data, 
second solution is to use a JS library like this
to pull all months on that field then filtered it similar to this, https://community.hubspot.com/t5/Content-Design-Questions/Blog-filters/td-p/3609
althought that is a different example but you can have the idea of using class/data attr.

its a lot of work though
best of luck,



0 Upvotes