Build a grid-based Instagram gallery
Build a fully-responsive Instagram gallery.
Use Zapier to connect your Instagram feed to a fully responsive, custom grid layout.
In this lesson, you’ll learn:
- How to create a Collection
- How to create a Zap to connect Instagram to your Collection
- How to design your Collection list
- How style the gallery
Good to know: The grid will add new Instagram posts to your layout, but it won’t grab all existing photos.
How to create a Collection
First, you’ll need to create and name a Collection (e.g., “Instagram feed”). Then, you’ll add a custom field for your Instagram images:
- Go to edit your Collection
- Go to the Collection fields section
- Click Add new field
- Choose the Image field
- Name the field (e.g., “Images”)
- Click Save field
- Click Create Collection
How to create a Zap to connect Instagram to your Collection
Zapier operates with a trigger event and result (i.e., when this happens, do that). When new images are posted to your Instagram account, this Zap (i.e., this whole process) will activate.
Note: Check Zapier’s documentation for the most up-to-date instructions for creating trigger events.
First, create a trigger event in your Zapier account
- Select Instagram under Choose App & Event
- Select New Media Posted in My Account from the dropdown for Choose Trigger Event
- Click Continue and enter your Instagram account information
Once you connect your account, you can Test and Continue.
Then, you can set the result by connecting the trigger event to Webflow:
- Select Webflow under Choose App & Event
- Select Create Live Item from the dropdown under Choose Action Event
- Click Continue
- Choose your Webflow account under Choose Account
- Click Continue
- Choose Photostories for your Site under Customize Item
- Choose Instagram feeds under Collection to link it to the database we created earlier
- Choose Standard Resolution URL under Images to bring in new images posted to Instagram
- Set the Name to grab the caption text
- Set both Archived and Draft to No (for now)
- Click Continue
Now, click Test and continue again and you’re ready to activate your Zap. In the top right, verify your Zap is switched ON.
How to design your Collection list
Before you start designing your Collection list, you may want to post a new image or two to your Instagram account. That’ll trigger Instagram to pass new photos to your site.
To design your Collection list in Webflow:
- Go to Add panel > CMS section
- Add a Collection list to the canvas
- Double-click the Collection list
- Choose “Instagram feeds” as the Source Collection
This populates your Collection list wrapper with an item for every new image you uploaded to Instagram at the beginning of this section.
Note: Images can take time to show up. Refresh your Webflow site if you don’t see updates right away.
Then, you’ll want to structure your Collection list to display your Instagram images inside. First, add an image element to your Collection list wrapper:
- Go to Add panel > Media section
- Drag an image element into any of the items in the Collection list
- Select the image on the canvas
- Click the settings “cog”
- Check “Get Images from Instagram feed”
- Choose the “Images” Collection field from the dropdown
Next, create a grid layout for your images:
- Select the Collection list
- Go to Style panel > Layout > Display
- Choose grid
You can edit your grid as needed. Then, you can add a lightbox so when a site visitor clicks the image, it shows up in a lightbox:
- Delete the previously added image (don’t worry, you’ll replace it later)
- Go to Add panel > Advanced section
- Drag a lightbox element into any of the items in the Collection list
- Click the placeholder image inside the lightbox
- Click the settings “cog”
- Check “Get Images from Instagram feed”
- Choose the “Images” Collection field from the dropdown
- Select the Lightbox link
- Go to Element settings panel > Lightbox settings
- Check “Get Media from Instagram feed”
- Choose the “Images” Collection field from the dropdown
- Check Link with other lightboxes
- Give the lightbox group a name (e.g., “Instagram”)
How to style the gallery
Here’s where you can style your grid and give your pictures a “picture frame” look.
First, create the picture frame:
- Go to Add panel > Basic section
- Drag a div block inside the Lightbox link
- Give the div block a class (e.g., “Frame”)
- Drag the previously added image element into the div block
Then, style the frame:
- Select the “Frame” div block
- Go to Style panel > Borders
- Choose solid in Style
- Add a width (e.g., 10px)
- Go to Style panel > Spacing
- Add padding (e.g., 35 px) on all 4 sides
- Go to Style panel > Layout
- Set Display to flex
- Set Align to center
- Set Justify to center
Now, you can add realism to your frames with a first shadow:
- Select the “Frame” div block
- Go to Style panel > Effects
- Click the “plus” icon next to Box shadows
- Set a Distance value (e.g., 20px)
- Set a Blur value (e.g., 50px)
- Set a Size value (e.g., -9px)
- Click the color swatch and change the opacity by setting the alpha channel (e.g., 40%)
- Click out of the color picker
- Set an Angle value (e.g., 180 degrees)
And then set a second shadow:
- Select the “Frame” div block
- Go to Style panel > Effects
- Click the “plus” icon next to Box shadows
- Set a Distance value (e.g., 13px)
- Set a Blur value (e.g., 19px)
- Set a Size value (e.g., -13px)
- Set an Angle value (e.g., 180 degrees)
How to make your grid row height consistent
- Select the Collection list
- Go to grid edit mode
- Select each row (including the automatic row) in the Style panel and set its size to 1FR
- Exit grid edit mode by pressing ESC or clicking Done on the canvas
- Select the Collection item
- Go to Style panel > Size
- Set Height to 100%
- Select the Lightbox link
- Go to Style panel > Size
- Set Height to 100%
- Select the “Frame” div block
- Go to Style panel > Size
- Set Height to 100%
Lastly, you can style your grid to best fit each breakpoint. New Instagram images will be added to your gallery automatically.
And that’s building a grid-based Instagram gallery in the Webflow designer.
Learn more: