Skip to main content
  • X Twitter
  • youtube
Home
Drupal 4U
Built for AI. Powered by Drupal.
  • Home
  • Showcases
  • Services
  • Blog
  • Themes
  • About
  • Contact

Breadcrumb

  1. Home
  2. HowTos
  3. Shadowbox gallery displays only the first image on a multi-image field (option "compact")

Shadowbox gallery displays only the first image on a multi-image field (option "compact")

HowTos
June 13, 2014
Profile picture for user drupal
By drupal
  • facebook-f
  • twitter
  • envelope
  • print
10

In 7.x-3.0-beta5 version a new compact parameter has been added to the shadowbox formatter. So if you have an image field (multimage, accepts more than 1 image) and you set its formatter as shadowbox with gallery type and compact checked, you will get a gallery in which only the first image thumbnail is displayed and when you click on it shadowbox is opened and you can view all the images there.

https://drupal.org/node/1107162

However, this function apparently does not work properly. Yes, only the first image thumbnail is shown, but when you click you can only see the first image in the shadowbox gallery. The cause is apparently a bug in the shadowbox module.

https://drupal.org/node/2106133

The problem is very easily fixed by editing one line of the file shadowbox.module

https://drupal.org/node/1980380

diff --git a/shadowbox.module b/shadowbox.module

index 9531a81..3b05b1d 100644

--- a/shadowbox.module

+++ b/shadowbox.module

@@ -555,5 +555,5 @@ function theme_shadowbox_formatter($variables) {

$wrapper_classes = ($gallery_id != '') ? "sb-image sb-gallery sb-gallery-$gallery_id" : 'sb-image sb-individual';

- return '' . $output . '';

+ return '' . $output . '';

}

Shadowbox gallery displays only the first image on a multi-image field (option "compact")
Troubleshooting

Read more articles

Newer
How to make the Drupal superfish menu work properly with the Drupal theme MD Alpine (7.x-2.6 )
Older
The sharing URL link does not show the thumbnail image on Facebook
  • Log in to post comments
Profile picture for user drupal
drupal
10
1
min read
A- A+
  • facebook-f
  • twitter
  • envelope
  • print

Contact Us

Get in touch for questions and our Drupal development, design and optimization services.

Contact Us

We aim to reply the latest within 48h.

Drupal 4U: Built for AI. Powered by Drupal.

We are a group of Drupal designers, developers and webmasters. We are Drupal experts! We provide comprehensive services that go beyond traditional web development, focusing on how AI understands, interprets, and cites your content. With our deep expertise in Drupal's architecture, we build the intelligent core of your digital presence, ensuring your brand remains authoritative and visible in a world where AI is the primary gatekeeper of information. Partner with us and let's future-proof your digital strategy together.

  • X Twitter
  • youtube

Drupal Services

  • Drupal Web Design
  • Drupal Development
  • Drupal SEO
  • Drupal GEO
  • Drupal Migration

Drupal 4U

  • Services
  • Showcases
  • Themes
  • Blog
  • About

Drupal Links

  • Official Drupal Website
  • Theme Forest
  • Gaivas Themes
  • More Than Themes
  • DXPR: Drupal for Marketers
  • Drupal Answers
2012 - 2025, Drupal 4U

Footer menu

  • Contact
Home
Drupal 4U
Built for AI. Powered by Drupal.
  • Home
  • Showcases
  • Services
  • Blog
  • Themes
  • About
  • Contact
Clear keys input element