Claim the FREE Multi Step Form - Learn How

As I update this every so often, you may want to the live example for the latest changes. You can either view the final result 1.1k or looks at it in the designer (share link) 458 for those who want to look a bit deeper into it.

The lack of CMS support for the lightbox feature has been somewhat annoying, however today I have worked out a fully-functional solution! All it takes is a simple HTML embed and you'll have a functioning lighbox that updates with your CMS collection.

Step 1: Create a dynamic list
Step 2: Connect if to your desired CMS collection
Step 3: Insert the HTML embed into the dynamic item
(gallery-container and gallery-item are just my style names for my gallery)

Step 4: Add the HTML Code:
Full text available to copy at the bottom of this post.

CMS-lightbox.jpg815x629 67 KB

To get this code I created a standard lightbox as a test and then copied the code from Chrome's Inspector. I removed a couple of the script codes for width and height that would screw up some of my other images, and I added dynamic fields for the image's url I wanted.

THUMBNAIL IMAGE - I used the same image from my thumbnail and full shot while I was testing this, but in proper implementation of this I would make a thumbnail image in my collection template, and set that in the <img src="">

Lightbox Group - you can also specify a lightbox group to link them all together. I didn't in this version, but you would just replace the "photo-gallery" with a dynamic field, or you can just leave it as this if you only have one lightbox on your page.

Step 5: Save and close.
The published website should now have a functioning photo gallery!

HTML TEXT

<a class="w-inline-block w-lightbox" href="#">
 <img src="(image-thumbnail-field)" />
 <script class="w-json" type="application/json">
   {
     "group": "(your-group-name)", "items": [{
       "_id": "57e0683ebfc7a6d0523235b2",
       "cdnUrl": "(image-field)",
      "type": "image",
      "url": "(image-field)"
     }]
   }
 </script>
</a>

I hope this helps some people!


This product is not yet available. Join us on twitter for updates.

What’s a Rich Text element?

The rich text element allows you to create and format headings, paragraphs, blockquotes, images, and video all in one place instead of having to add and format them individually. Just double-click and easily create content.

Static and dynamic content editing

A rich text element can be used with static or dynamic content. For static content, just drop it into any page and begin editing. For dynamic content, add a rich text field to any collection and then connect a rich text element to that field in the settings panel. Voila!

How to customize formatting for each rich text

Headings, paragraphs, blockquotes, figures, images, and figure captions can all be styled after a class is added to the rich text element using the "When inside of" nested selector system.

This product is not yet available. Join us on twitter for updates.