Using the filter groupby() with a custom blog field.

ChadP
Contributor

I have a blog that I am trying to output onto another template. This blog has a custom field called 'state' a choice module.

 

I can out put the field in the for loop but I am tryingto use the filter groupby() and filter by the field.

{% set statesTerr = blog_recent_posts('BLOG_ID', 100) %}
{% for group in statesTerr|groupby( 'widgets.stateTerritory.body.value' ) %}
// BLOG LOOP HERE
{% endfor %}

 The problem is that it isnt working it errors on me. I am using the same basic loop in another page using the sort() filter and it is working

 

 {% for past in pasts|sort(True, False, 'widgets.historyYear.body.value') %}
    
        // Blog Loop
    
    {% endfor %}

What Gives. Cat Frustrated

 

0 Upvotes
1 Reply 1
roisinkirby
HubSpot Product Team

Hey @ChadP is this still something you are working on or were you able to find a solution? If not I'm happy to connect you with some of our design experts Smiley Happy

0 Upvotes