I want to use custom code to a collection list. Now I need to give every collection list item an independant class so they get each different attributes. Is this possible? As every time I change one class every collection item is going to get this class not the one I want only.
No, all the collections items are completely identical.
The only way I know to style them differently would be to use custom code and pseudo elements, targetting 1st, 2nd, nth child of a collection list. It has limitations, but depending on what you’re trying to achieve, it could be possible.
Just FYI, when Webflow designers want to have various style within a collection list, they use several collection lists and they work the sorting to make it look like a continuous flow of dynamic items.
For example, check www.larochelle.today : it’s really one list of dynamic content, but it’s using 5 collection lists.
Interesting. I just checked but I’m not fully getting it. By slug you mean Name right? But it’s not used as a class for the item, so how would you target an item?
I don’t get how you give a CMS item a class using the field name and custom code. I see how you can add an element inside of it, with a class that’s using the Name field, but wrapping the content of a CMS item inside of one, or adding a class to the item, I don’t see how.
Edit: well you could add a div class:slug in the item, then a wrapper for all your item content just afterwards, and use pseudo to target the next element after the div class.slug. Is that what you have in mind?
I know how this works, but if I use a collection list with cms I cannot refer each different collection item a different class to then point them to each different filter type
However if I get in a collection list and add at every item a button lets say to link somewhere. How can I link independently with each button to a other site? Atm if I link one button to one site and automatically all buttons from the list refer to the same page?