| Project: | Lightbox2 |
| Version: | 7.x-1.0-beta1 |
| Component: | Code |
| Category: | feature request |
| Priority: | major |
| Assigned: | Unassigned |
| Status: | patch (to be ported) |
Issue Summary
The dubious amount of field formatters for Lightbox2 had been bugging me for quite some while.
I'm talking about the multitude of "lightbox/lightshow__image style__lightbox style" style formatters.
Imagine having 10 image styles (that's not so far fetched, I think). That will lead to no less than a hundred formatters in the display list!
I propose these obviously config level settings to be handled by not additional formatters, but the field_formatter_settings_form hook (as such settings should be).
I've implemented such a single formatter with the ability to configure the following settings per field instance:
- Lightbox type: lightshow or single lightbox.
- Image style: a select list of image styles. What to display as a thumbnail.
- Lightbox style: a select list of image styles. What to display inside the lightbox itself.
- Caption field: a list of image entity fields to choose which field to display as a caption (this one could be later replaced by some more refined display type, e.g. an added 'lightbox' display mode for image file types, etc.).
I've attached a patch including these features, hope it can be ported a.s.a.p.
| Attachment | Size |
|---|---|
| lightbox_field_formatter_settings_implementation.patch | 7.34 KB |
Comments
#1
I fixed a very minor bug in the settings form (double array enveloped options, LOL).
I also attached some screenshots of how the feature works.
Note how where there previously were dozens of formatters, there is now only a single one.
I believe configuring a lightbox2 display with this newly added settings form is much more instinctive to use.
I need feedback on this!
#2
Great improvement, thank you.
However, the patch didn't apply properly (against 7.x-1.0-beta1):
patching file lightbox2.formatter.incpatching file lightbox2.module
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n] y
Hunk #1 FAILED at 786.
Hunk #5 FAILED at 1049.
Hunk #6 succeeded at 1065 (offset -3 lines).
Hunk #7 succeeded at 1116 (offset -3 lines).
2 out of 7 hunks FAILED -- saving rejects to file lightbox2.module.rej