This feature is currently only supported on homepage and list pages (i.e., taxonomies and section lists).
Second, it seems like Hugo’s taxonomy system would handle most of this for you. Try it:
git clone --single-branch -b hugo-forum-topic-36496 https://github.com/jmooring/hugo-testing hugo-forum-topic-36496
cd hugo-forum-topic-36496
hugo server
In this example:
Products 01-30 are members of Collection A
Products 31-60 are members of Collection B
Products 61-70 are members of both collections
The collection (term) pages are paginated (layouts/term/collection.html)
The collection (term) pages render each product using a content view (layouts/products/li.html)