Add info for gallery support to docs

Created on 15 June 2021, over 3 years ago
Updated 17 April 2024, 8 months ago

Please add info to docs showing how to add gallery support to inline colorbox galleries. This is done by adding data-colorbox-gallery="" to the linking element with your own custom value.

✨ Feature request
Status

Active

Version

1.2

Component

Documentation

Created by

πŸ‡ΊπŸ‡ΈUnited States Stephan Barrett

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States johnhanley

    This issue is nearly 3 years old, but documentation for Colorbox gallery support still isn't included on the project page or in the README.md.

    In the meantime, the process is super straightforward. Simply add the attribute "data-colorbox-gallery" to each anchor tag with whatever name for the gallery. E.g. data-colorbox-gallery="image-gallery"

    Be sure the "data-colorbox-inline" attribute is unique and matches the id of the link. For instance, I appended the media file ID.

    Colorbox will handle grouping all the images together in a gallery and add the appropriate pagination links.

    To define the caption that appears in the lower left-hand corner, simply add a "title" attribute to the anchor tag.

    Here's a complete example using replacement tokens in "Rewrite results":

    <a data-colorbox-inline="#data-image-{{ value_2 }}" data-colorbox-gallery="image-gallery" title="{{ value_3 }}"><img alt="data-image-{{ value_2 }}" data-entity-type="file" date-entity-uuid="" id="data-image-{{ value_2 }}" src="{{ value_1 }}" /></a>

    Be sure to exclude all the field values except for the image thumbnail.

Production build 0.71.5 2024