I’m trying to create a recomended carousel where I’m fetching all blog posts from a particular tag using the blog_popular_posts function. Here’s my code right now.
{% set posts = blog_popular_posts(group.id, 11, 'Animation') %}
So while this is all working, it also does include the ‘current’ page blog post and I’m trying to exclude it using the rejectattr or selectattr filter. Here’s how my code look like now.
{% set posts = blog_popular_posts(group.id, 11, 'Animation') %}
{% set posts = posts|rejectattr('absolute_url', 'equalto', content.absolute_url %}
I’m expecting it to return all the posts except the post that belongs to the current page I’m on but it’s not returning me anything.
---
For reference, here is what blog_popular_posts returns
(SizeLimitingPyList: [BlogPost 53605467259 Horror Creatures with Molly Brown, BlogPost 53675010744 Test webinar, BlogPost 53608133921 Part 1: Creating Assets and Understanding What Sells, BlogPost 53605467691 Part 2: How to Package, Price, and Sustain Your Business])
which i’m assuming are objects that should work with the selectattr and rejectattr filters?