To create a modal view for glossary terms using CMS collection content in Webflow, you can use a combination of Collection Lists, interactions, and hidden modal elements.
Modal Wrapper
.Webflow doesn’t natively support dynamic modals for each CMS item, so use custom attributes to pass CMS data:
Add Field > Term
Add Field > Definition
) to include this JavaScript:
<script> document.querySelectorAll('[data-term]').forEach(btn => { btn.addEventListener('click', function() { const term = this.getAttribute('data-term'); const definition = this.getAttribute('data-definition'); document.querySelector('#modal-term').textContent = term; document.querySelector('#modal-definition').textContent = definition; document.querySelector('#modal-wrapper').style.display = 'flex'; }); }); document.querySelector('#modal-close').addEventListener('click', function() { document.querySelector('#modal-wrapper').style.display = 'none'; });</script>
#modal-wrapper
#modal-term
#modal-definition
#modal-close
To show CMS glossary terms in a modal:
This setup creates an efficient, scalable modal interface powered by your Webflow CMS.