I am trying to pull together a custom collection of all item pages (articles in a blog):
{% set my_pages = page.collection({
‘items’: ‘@root.descendants’,
‘order’: {
‘by’: ‘random’,
‘dir’: ‘desc’,
},
})
.ofType(‘item’)
%}
I would assume that no matter on what page I execute this and then run
{{ dump(count(my_pages)) }} - I always get the same count (in our example, let’s say I have 50 item pages which have different categories). However, the behavior is a bit different.
- on the blog page it shows the correct count of pages (50)
- on an inidivudal item page, it also shows correct count of pages (50)
- however, if I run this code on a taxonomy listing page: domain.com/blog/category:blue - the count only shows the number of items in category blue (ex: 5)
Do I misunderstand how my custom collection works or do you know why it will not show count 50 on the category page?
thanks much