# Generate a grouped list

**URL:** <https://forum.finsweet.com/t/generate-a-grouped-list/1781>\
**Category:** Attributes\
**Created:** [August 14, 2023, 3:02pm UTC](https://forum.finsweet.com/t/generate-a-grouped-list/1781 "2023-08-14T15:02:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![guy](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/guy/32/1237_2.png) [@guy](https://forum.finsweet.com/u/guy)\
**Post date:** [August 14, 2023, 3:02pm UTC](https://forum.finsweet.com/t/generate-a-grouped-list/1781/1 "2023-08-14T15:02:23Z")

</div>

Hi guys, is there way to generate a list of items where the results are divied into groups of for example 5 items each (wrapped by an extra div or marked with a numbered class)? The idea is to get an output of a list that I can use in a grid. Here’s an example I’m working on:  
[https://manvanhetwoord.webflow.io/daden](https://manvanhetwoord.webflow.io/daden)  
It’s an abstract bookcase with shelves to divide the results (books) into. I got there half way-ish by making a limited list per shelf. But filtering is out of the question this way… And it’s not a sustainable solution as I have to pre-make some lists for the grid…  
Is there a way to get it done with Attributes?

---

<div class="post-metadata">

**Author:** ![Support-Luis](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/support-luis/32/53_2.png) [@Support-Luis](https://forum.finsweet.com/u/Support-Luis)\
**Post date:** [August 14, 2023, 6:59pm UTC](https://forum.finsweet.com/t/generate-a-grouped-list/1781/2 "2023-08-14T18:59:45Z")

</div>

Hey @guy! I am afraid there is no native solution with Attributes for this.

You could write some code that separates the elements by some criteria and then appends these elements to the corresponding divs in the bookcase.

Filtering all these lists will be the fun part so let me know if you want to go this route and we can come up with a way to make it work 🙂

---

<div class="post-metadata">

**Author:** ![guy](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/guy/32/1237_2.png) [@guy](https://forum.finsweet.com/u/guy)\
**Post date:** [August 15, 2023, 11:58am UTC](https://forum.finsweet.com/t/generate-a-grouped-list/1781/3 "2023-08-15T11:58:59Z")

</div>

Hi @Support-Luis, thanks for responding. To bad Attributes/Webflow isn’t doeing this (yet). But on the Webflow forum I found someone who had a little script that does the job of grouping the output! I’ll leave the link in this post for anyone who’s interested 🙂  
Filtering though with Attributes in this solution doesn’t work as the list output doesn’t get grouped again.

> **[Divide Collection List into sub groups](https://discourse.webflow.com/t/divide-collection-list-into-sub-groups/119653/2)**
>
> You sir, made my day! This was exactly what I was looking for. Trying to distibute list items in a grid, with x-items per grid cell. Thank you for sharing!

---

<div class="post-metadata">

**Author:** ![Support-Luis](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/support-luis/32/53_2.png) [@Support-Luis](https://forum.finsweet.com/u/Support-Luis)\
**Post date:** [August 15, 2023, 4:33pm UTC](https://forum.finsweet.com/t/generate-a-grouped-list/1781/4 "2023-08-15T16:33:52Z")

</div>

Sweet! Thanks for sharing! 💪
