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 couldn't get the description to show up on the gallery thumbnails even though title & description was enabled.
I added the following line:
$meta_vars['description'] = drupal_render_children($element);
right above //Theme the metadata in the following function template_preprocess_media_gallery_media_item_thumbnail() in the file media_gallery.theme.inc
Once I added the line, I could go the file types display and enable and disable the fields I wanted to see on the Gallery Thumbnail tab. (admin/config/media/file-types/manage/image/display/media_gallery_thumbnail)
Hope this helps someone.
Comments
Comment #1
hejeva CreditAttribution: hejeva commentedThis line works better -- getting only the description.
$meta_vars['description'] = isset($element['media_description']) ? $element['media_description'][0]['#markup'] : '';
Comment #2
lsolesen CreditAttribution: lsolesen commentedPlease create a patch, if you want us to test whether it works?
Might also be related to:
- #1162672: Cannot show a description above every photo in gallery thumbnail
- #1391806: Putting descriptions below images
And when showing in colorbox
- #1676266: Show title and description - Colorbox doesen't works
- #1667524: Description not displaying in lightbox
Could you please review those issues to see whether it is the same as your issue?
Comment #3
ivnish CreditAttribution: ivnish commented