CMS Development

ChadP
Colaborador(a) | Parceiro Elite
Colaborador(a) | Parceiro Elite

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

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. Gato Frustrado

 

0 Avaliação positiva
1 Resposta 1
roisinkirby
Equipe de Produto da HubSpot
Equipe de Produto da HubSpot

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

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 Avaliação positiva