Unique IDs in Collection Items

I think I found a solution that did what I needed. I dropped this in the div that I want to give a unique ID to, and used the “Slug” as the ID name.

<script>
document.currentScript.closest('div.w-dyn-item').id = 'SLUG';
</script>

Then I followed these instructions but swapped out the ID for the div text:

2 Likes