Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I would like to take advantage of the Galleria support for data layers added in version 1.2.5.
Some implementation thoughts:
- Use the file_entity module to augment images, etc., with a layer field, e.g. a text area field. The user creates a field for this purpose or uses an existing one.
- Create a new galleria field formatter setting that optionally identifies the "layer" field.
- Change the galleria formatter view implementation to use the layer field. The layer field's rendered value is inserted into each image as an "attributes" element such that the rendered <img> tag has the 'data-layer' attribute needed by the Galleria library.
I've successfully prototyped this approach and am happy to share it if there's interest. If there is a better way, I might try to implement that too.
Comment | File | Size | Author |
---|---|---|---|
#2 | Patch to add a data layer | 5.27 KB | mfgering |
#2 | Screen cap of settings | 12.69 KB | mfgering |
Comments
Comment #1
pjbarry21 CreditAttribution: pjbarry21 commentedI'd also love to see this feature added. I saw that it was added in Views jQFX Galleria before that was deprecated, but I'm having trouble getting that module to do what I want to do and Views Galleria is working well, other than not having this feature. Any chance it can be integrated into the module?
Comment #2
mfgering CreditAttribution: mfgering commentedIf you want to play, here's a patch that adds a "data layer" setting to the formatting options. To use it, you need to install the file_entity module. Then you can optionally add fields to image and file entities. Then you will see a new option in the field format settings for selecting the data layer:
A text field with full html for the data layer works well.
Let me know if you problems, questions, suggestions.
Comment #3
pjbarry21 CreditAttribution: pjbarry21 commentedThanks for the patch/suggestion.
I did get it installed, but it isn't quite working. I get errors in the view at times (about the height/width css issue -- we've had that in the past), sometimes not all images appear, and when it does work, I've only got 2 data layer fields to choose from -- alt or title text (neither of which appears in the slideshow after selecting them). We were hoping to put the body text as the additional data layer (that's where our full captions are -- title and alt already have some limited info, but not the full caption). I tried creating an option set to see if that had any effect and there was no change. I changed the view from just a slideshow to galleria and that had no (positive) effect. Not sure if this is just not possible or something with our installation (we do have LOTS of modules installed).
If you have a moment for suggestions or things I could check, that would be welcome. Thanks.
Comment #4
jamesbenison CreditAttribution: jamesbenison commentedSee http://drupal.org/node/1923148#comment-7244042
Comment #4.0
jamesbenison CreditAttribution: jamesbenison commentedescaped img tag in description