.w-dyn-item
exists, and hide the wrapper div if no items are found.Yes, you can automatically hide the section on your Webflow homepage when there are no CMS events using Webflow’s built-in “Conditional Visibility” feature. Here’s how to do it:
Add a small Embed component below the Collection List (but inside the Events section container).
Use JavaScript to check if the Collection List is empty:
Example (inline reference only):
Use loading="lazy"
on your embed and script that checks whether the number of .w-dyn-item
inside the .w-dyn-list
is zero, then apply .style.display = 'none'
to the containing div.
Example logic:
Check if .w-dyn-item
exists
If no items, set the wrapper div’s display to none
Use a combination of Webflow’s Collection List and a custom script to detect when no CMS items are rendered, then hide the entire Events section container dynamically. This ensures a clean homepage without empty sections when there are no events.