Section Modal
What You'll Create
A Squarespace lightbox or modal overlay that pulls a section or block from the same page and displays it in a popup — triggered by clicking any link. This is ideal for showing a video, gallery, or any content that should stay hidden until the visitor clicks to reveal it. The link pattern is simple: set any link to #sectionpop~bannervideo to display the section with the #bannervideo anchor in a styled overlay.
The Problem It Solves
Squarespace has no native way to show a section or block in a lightbox on the same page. If you want a video to play in a popup or a gallery to open in an overlay without leaving the current view, there's no built-in option. Third-party solutions often add bulk, require HTML editing, or conflict with Squarespace's structure. This technique lets you hide any section and reveal it in a clean modal with a single link.
Perfect For
Video lightbox players, Gallery detail popups, Hidden content reveals, Interactive demo showcases, Expanded product views
What Makes This Different
The system works entirely through link formatting and the script automatically finds the matching section on the same page and displays it in a styled dialog overlay. The source section can contain any content you've built in Squarespace, including video blocks and galleries. Gallery blocks inside the modal are automatically constrained to 50% max-width and centered for a clean presentation. The external CSS and JS files are lightweight and hosted, so setup is just two lines in footer code injection. Unlike the Page Modal which fetches content from other pages, this pulls directly from the current page — so JavaScript-powered components like videos load and play correctly. Classic editor is recommended for the source section.
Details
Section Type: Fluid & Classic
Code Type: CSS + JavaScript
Prerequisites: External CSS and JS added to footer code injection. A section or block on the same page with an anchor (e.g. #bannervideo).
Toolkit Title: Section Modal
Learn This Technique
This is one of 150+ code techniques taught inside Standout Squarespace, where you get:
The complete, copy-paste code
Video walkthrough explaining how it works
The principles behind the technique so you can customize it
Access to our private community for support

