I have a few fields in CMS that i wanna set as data attributes of the CMS item in the Collection List, anyone have a minimalistic way of doing this?
Before the solution was to add 4 text fields, refrence the CMS text for each field, display:hidden and put a ID on each of the attributes, then loop throught hem with JS and take each text field and add the attribute to the parent element.
However this requires me to have 4 extra elements for each CMS item, wich becomes a problem when you have 300 cms items on one page, it woudl result in 4x300 = 1200 more elements.
If i could add custom div attributes on the “CMS Item” and refrence the fields, no additional elements would be needed, nor any JS.
Anyone have a better idea of doing this?
I had a plan of adding an embedded and refrence the cms in there, Embeded =>