To show CMS Collection item details in a popup modal instead of navigating to a separate page, you’ll use a CMS list with interactions and a hidden content container. Here's how to do it.
1. Create the CMS Collection List
- Drag a Collection List into your page from the Add panel.
- Bind it to your desired CMS Collection by selecting the Collection source.
- Inside each Collection Item, add dynamic fields like Title, Image, Summary, etc.
- Add a "Read More" button or link that will be used to trigger the modal.
- Outside the Collection List (on the same page), add a Div block that will serve as your modal container.
- Style it as position: fixed, display: none, add a background overlay, and center the modal content inside.
- Inside the modal, add elements like an Image, Heading, Text block, and any other details you want to display.
- Assign each element a unique class and/or combo class so you can target them in interactions later.
3. Add Custom Attributes to Pull CMS Content (Optional if you don't want dynamic content)
- If you want the modal to show dynamic CMS content related to the clicked item, you’ll need to use Webflow interactions with some custom attributes or use custom JavaScript (Webflow interactions alone do not pull in CMS content dynamically into a modal unless the modal is inside the Collection List).
- Alternative approach: Place the modal structure inside the Collection Item, and show/hide it via interactions. This way, each modal is tied to its CMS item.
- This makes each modal specific to its Collection Item.
- Hide all modals by default, and use interactions labeled "Open Modal 1", "Close Modal 1", etc.
4. Set Interactions to Open and Close the Modal
- Select your “Read More” button/link, go to Interactions, and create a New Timed Animation on click.
- Set the interaction to change the modal’s display from none to flex or block, and fade in the opacity or move it into view.
- Add a close icon or area inside the modal, and assign a close interaction that hides the modal again by changing display to none.
5. Optional JavaScript for One Reusable Modal
If you want one centralized modal outside the collection, you can write lightweight custom JS that listens on clicked elements and pulls in the content using data-
attributes.
For example:
- Add
data-title
, data-image
, data-content
to your Read More button. - Use JS to populate the modal with those attributes on click.
However, this part requires custom code, since Webflow interactions don’t support dynamic content injection into a modal unless it exists within the Collection Item.
Summary
To display CMS Collection item details in a popup:
- Put the modal inside the Collection Item to reuse CMS fields directly.
- Hide modal by default and show on click using interactions.
- Alternatively, use custom JS and a single outside modal, but this requires manual attribute setup and coding.
This approach avoids loading a separate CMS page and enhances user experience with a dynamic modal without leaving the page.