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.
Hi,
I cannot figure out for the life of me how to get lightbox to work inside of a drupal based exhibit. I have done the same using a plain html page with:
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
and
<a ex:href-content=".example_1" rel="lightbox"><img ex:src-content=".example" /></a>
which works like a charm. Can anyone shed some light on how I can apply this to a drupal exhibit?
Thanks
7
Comment | File | Size | Author |
---|---|---|---|
#3 | Exhibit-Format-Lightbox.jpg | 43.89 KB | BDS |
Comments
Comment #1
rkarajgi CreditAttribution: rkarajgi commented7wonders:
Try thickbox instead - it works. I have used the Exhibit lens and have used thickbox within lens to get the thickbox popup from exhibit data.
- Rajeev
Comment #2
jthomasbailey CreditAttribution: jthomasbailey commentedYou've done it in Drupal? I spent all day yesterday trying to get title links to open with thickbox, greybox and lightbox in Exhibit/Drupal and it just didn't want to work.
Comment #3
BDS CreditAttribution: BDS commentedHi, checking in for any updates:
1) You can customize the format under View and Lightbox does show up as an option. However, I didn't get the Lightbox format to work on my site (it doesn't open to a Lightbox). It has, however, allowed me to chose the image cache set up and link it to the node without making any changes to the Exhibit Feed code.
2) If this Lightbox option work, it would be a roundabout option to addresses the issue (https://drupal.org/node/488174); opening the link in Lightbox will allow user to "maintain" their facet search state without sending them to a new page (or user can manually right-click open to new window...but for most, this isn't an option).
Bonal
Comment #4
diodata CreditAttribution: diodata commentedLightbox can work with Exhibit. You have to use Drupal Behaviors. Lightbox needs to process the DOM after it's generated, which can be tricky since Exhibit alters the DOM dynamically after the page loads. For me, I simply ran Drupal.attachBehaviors() once the Exhibit view, or whatever part of the DOM tree, is generated.
Below is code to run Drupal.attachBehaviors() once the Exhibit TabularView gets created. You should be able to do something similar for other Exhibit views. I have links in the Tabular View that open up external pages in Lightbox. You can probably focus the behaviors to specific sections of the DOM/page but I haven't tried that. This seems to run fast enough.
Comment #5
BDS CreditAttribution: BDS commentedThis sounds promising, thanks a lot! Where do you place this block of code at?
Comment #6
diodata CreditAttribution: diodata commentedAnywhere on your page. Just put it inside [script type="text/javascript"]
tags. You'll need to allow Full HTML for that text area (recommended) to allow script tags to pass through or hard-code it into your (file-based or contemplate-based) template (not recommended.)
Comment #7
BDS CreditAttribution: BDS commented