Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Now when clicking on the image in the lightbox, I get redirected to the full page view with pager of the images instead. It would be great if there was an option for setting that it closes the lightbox in the same way as clicking the close option in the lightbox.
Comment | File | Size | Author |
---|---|---|---|
#11 | Schermata.jpg | 205.73 KB | elgandoz |
Comments
Comment #1
camdarley CreditAttribution: camdarley commentedI agree with that feature. We may be able to choose between link to original (as it is now), close the lightbox (as tsvenson said), or slide to the next media (as it use to be in many galleries).
Comment #2
DartDev CreditAttribution: DartDev commented+1
Comment #3
elgandoz CreditAttribution: elgandoz commentedsubs! This is a must!, because it's very confusing.
Anybody out there knows where it's possible modifying the code?
Comment #4
camdarley CreditAttribution: camdarley commentedI think that's the answere is at line 292 of media_gallery.module but i'm not enough experienced to make modification myself :
Comment #5
camdarley CreditAttribution: camdarley commentedI think this issue should be merged with #1053674: Integrate with colorbox module
Comment #6
elgandoz CreditAttribution: elgandoz commentedOK i found it:
media_gallery.theme.inc
function theme_media_gallery_media_item_lightbox(), line 193;
Replace:
with
so the second line override the first (changing the first breaks the theme).
So the trick is to add an override of $link_vars['no_link'] in admin UI. It's thought for videos, but not as an option for photos.
I'm not a Drupal nor a PHP pro, anyway i will be glad to help (and learn something).
Comment #7
elgandoz CreditAttribution: elgandoz commented...mmm i think this option may suit better in "Gallery settings"
Comment #8
elgandoz CreditAttribution: elgandoz commentedComment #9
camdarley CreditAttribution: camdarley commentedchange title to fit better with the issue
Comment #10
elgandoz CreditAttribution: elgandoz commentedI noticed the #6 trick behaves in different way between my local copy and the production site. In thge second, scrollbars appear in both vertical and horizontal border. Also i can see another "frame" inside the lightbox. this do not appear in local. any idea?
Comment #11
elgandoz CreditAttribution: elgandoz commentedComment #12
stephandale CreditAttribution: stephandale commentedTo avoid hacking the module code, you can always use Javascript to alter the behaviour of the click action. This example makes a click on the item move to the next item:
Comment #13
camdarley CreditAttribution: camdarley commentedstephandale solution seems great.
I did this to make it working:
in media_gallery.theme.inc, replace
by
then create colorbox-behavior.js with following code :
Comment #14
Chipie CreditAttribution: Chipie commented+1
Comment #15
Chipie CreditAttribution: Chipie commentedWhere do I have to put this js code?
Comment #16
camdarley CreditAttribution: camdarley commentedIn the media-gallery module folder, you have to create colorbox-behavior.js near colorbox-display.js.
Comment #17
TripX CreditAttribution: TripX commented+1
Comment #18
totap CreditAttribution: totap commentedthank you. good work
Comment #19
niccolox CreditAttribution: niccolox commentedthere are two places where this is replace needs to happen, lines 115 and 357
for the Media Gallery blocks and gallery pages
.. not sure if I needed to do this, but I also implemented the Colorbox module integration patch and installed the latest 1.7 version of Prototype JS...
anyway, cheers
Comment #20
greggus-1 CreditAttribution: greggus-1 commentedGreat! Subscribing...
Comment #21
axe312 CreditAttribution: axe312 commented+1 :)
thx for the workaround in #12
Comment #22
bkosborne+1, this should be a setting on a per-gallery process.
Comment #23
drupal a11y CreditAttribution: drupal a11y commentedAll in all I guess best would be some more options on the admin-pages (admin/config/media/galleries) of media gallery for non-programmers.
Comment #24
drupal a11y CreditAttribution: drupal a11y commentedDoes solution #13 still work on the current dev? I can´t get it working.
Comment #25
John Sluder CreditAttribution: John Sluder commentedTo implement the fix from suggestion #12
scripts[] = js/media_gallery_hack.js
Comment #26
Carlos Miranda Levy CreditAttribution: Carlos Miranda Levy commentedSolution #6 still works
In 7.x-1.0-beta7, it's on line 209.
Solution #25 does work too.
Keep in mind subdirectories if you are working on a subtheme.
Comment #27
dimitriseng CreditAttribution: dimitriseng commentedHi. I have tested the solution suggested at #13 and this seems to be working ok, thank you! I prefer this solution over #25 as I would not like to change a theme file for changing the behaviour of module.
Can somebody please confirm if this is going to be commited and in what form? I guess that the best solution would be to make this option available via the admin GUI so that the user can select the required behaviour.
Comment #28
dimitriseng CreditAttribution: dimitriseng commented... I forgot to mention that I had also applied patch #44 from #1053674: Integrate with colorbox module and they seem to be working ok together, so hopefully both will get commited, although I think that for this we should also have a configurable setting for the behaviour.
Comment #29
dimitriseng CreditAttribution: dimitriseng commentedThis seems to be working ok. A few questions to move this forward:
- Do you agree to get this functionality in?
- Do you agree to go with the solution proposed in #13 (requires changes in the module) Vs #29 (which requires changes in theme files)?
- Do you agree to try and make this configurable via the GUI, or should this be left as is for now so that this can be commited faster?
Thank you.
Comment #30
tikiwebsites CreditAttribution: tikiwebsites commentedI needed this solution (difficult to find) and I went with #25. In response to dimitriseng, it might depend on how you are utilizing colorbox. In my case, I'm using media gallery, which uses the colorbox plugin, not module, therefore solution #13 is irrelevant to me. Additionally, I'm using Zen as my theme, so I'm a mad theme editor anyways, so editing those files didn't pose a particular concern to me; not to mention I tested it on a dev site first in case something did go wrong, before going live.
The only thing I did different was change the script name to media_gallery_click_next.js (hack was a little too generic for my tastes), but l suppose it would be more accurate to call it colorbox_click_next.js.
The only other consideration you should make, as seen in the Zen theme's js readme file, is that referring to the script in the theme.info file will make the change "sitewide" but if you want to make it conditional, then:
I agree that this should be an option in the module configuration and I would consider it fixed if the plugin "fix" was documented... But, I'm happy with the current work-around.
Mahalo!
Comment #31
crnjin CreditAttribution: crnjin commentedcamdarley thank you very much, helped me with # 13
Comment #32
gertderidder CreditAttribution: gertderidder commentedThanks tikiwebsites to point out that solution #13 is irrelevant for the media gallery!
Also big thanks to John Sluder and stephandale!
Comment #33
camdarley CreditAttribution: camdarley commentedActually, I forgot to mention that I patched media_gallery with #1053674: Integrate with colorbox module before the modification in #13. So this is the colorbox module which is used.
Comment #34
UrmasZ CreditAttribution: UrmasZ commentedI am using solution #25 also. Working well. Thanks. :)
Much needed fix.
Comment #35
Rob C CreditAttribution: Rob C commentedFor now, i'm all in favour of implementing this, but...
Can't we implement this as an option somewhere? "Gallery popup click behaviour" sounds a bit long tough... (i'm just thinking out loud here, but i wonder if this would make sense, because something with an editable field where you for example (somewhere in the future) can use tokens to build a url to use for the click action would open some new posibilities.) (but this might be something to look at from a distance and think long n hard about, because in other situations you might also want to add/change default behaviour and wouldn't it be awesome if we can create a view with a thumbnail, set the link for a media field and set the action via something like the styles module. so without to much work, you can get a view (that renders a thumbnail) to create a popup (on click), with colorbox intergration going on now, etc, etc.) (and we already have the linked/unlinked thumbnail option n such.) (running on media 2.x / media gallery dev patched / styles) Install the styles module and then visit admin/structure/file-types/manage/image/file-display/media_gallery_thumbnail for example to see where we could place an option. The media_youtube module also provides options (including js) on such a page.
Comment #36
sumaiyajaved CreditAttribution: sumaiyajaved commented#25 worked for me, I am using drupal 7. Thank you
Comment #37
Bernsch CreditAttribution: Bernsch commentedScript-hack in #25 works for me.
Tested with picture-gallery. NOT with (youtube)videos...
Thank you!
edit: I test a gallery with picture and videos (media:youtube module) and it works fine:
Klick on the video --> it starts and stops.
Klick on a picture --> go to next picture.
Comment #38
Richard_1618 CreditAttribution: Richard_1618 commented#6 worked perfectly for me!
Comment #39
Valera Tumash CreditAttribution: Valera Tumash commentedComment #25 work for me as well, but with some modification:
I added into my Zen template.php file (sites/default/themes/THEME_NAME/template.php):
So in the result 'media_gallery_hack.js' is added only to Media Gallery pages. And of course, I commented out js link from info file:
;scripts[] = js/media_gallery_hack.js
Hope this can help.
Comment #40
neomax38 CreditAttribution: neomax38 commentedSorry for my English. Topic Simple Corporate, doing everything according to the instructions of John Sluder, but it does not work. What could be wrong? How can I fix it?
Comment #41
CandieBandit CreditAttribution: CandieBandit commentedIf the gallery is PURE images (as in - not using video media) I figured a quick and dirty fix for this is to override the 'next' button's CSS to make it cover the whole image in the lightbox:
#cboxNext {background:none;width:100%;height100%;}
I remove the background image as the user will quickly work out that clicking the image will take them forward, common sense doesnt need a next button imo.
Hope this is helpful to someone.
Comment #42
ivnish CreditAttribution: ivnish commentedComment #43
ivnish CreditAttribution: ivnish commentedComment #44
ivnish CreditAttribution: ivnish commented