Problem/Motivation

I'm creating a content type to use as a photo gallery. It would be nice to have a FieldFormatter with WxT that automatically formats a Media field to use Lightbox as described in the wet-boew Lightbox working example - https://wet-boew.github.io/v4.0-ci/demos/lightbox/lightbox-en.html

Steps to reproduce

I created a simple content type for this, and added a Media field with unlimited cardinality. The bulk media creation already in WxT works well, it allows me to upload multiple photos at the same time and it converts them into media entities and attached them to my field:

Adding bulk images:
Bulk media UI

Bulk media entity creation:
Bulk media entity creation

Bulk media added to field:
Bulk media added to field

Now I don't have a field formatter to display the resulting photo gallery in a WET Lightbox.

Proposed resolution

Add a new FieldFormatter to display a simple Lightbox photo gallery, like image below.

Media gallery result

Add settings to the FieldFormatter to allow selection of image styles, one for the small preview image and one for the large image rendered in Lightbox:

Photo gallery settings

Comments

smulvih2 created an issue. See original summary.

smulvih2’s picture

Status: Active » Needs review
StatusFileSize
new5.6 KB

The patch adds the WET Lightbox FieldFormatter to the wxt_ext_media_image module.

smulvih2’s picture

StatusFileSize
new30.24 KB
new151.86 KB

So now I added my Media field to a view, and I get the FieldFormatter with the config form:

WET lightbox FieldFormatter view configuration

And the resulting view displays the thumbnails with lightbox as expected:

Resulting view

smulvih2’s picture

StatusFileSize
new5.79 KB

New patch accounts for translated alt text in the lightbox.

smulvih2’s picture

Version: 5.4.x-dev » 6.1.x-dev
joseph.olstad’s picture

Very nice work!

smulvih2’s picture

Tagging this with OCOL.

smulvih2’s picture

Status: Needs review » Reviewed & tested by the community

This will be included in next release. We have been using this field formatter for a few months now with OCOL and it's working great!

  • smulvih2 committed fc687752 on 6.1.x
    Issue #3520518 by smulvih2: WET Lightbox FieldFormatter
    
smulvih2’s picture

Status: Reviewed & tested by the community » Fixed

Included in 6.1.2.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.