Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Lightbox not working

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1 2
Go to End
Author Topic: 4778 Views
  • evangogh
    Avatar
    Community Member
    4 Posts

    Lightbox not working Link to this post

    I have installed the Gallery module but cannot get the lightbox to open. The gallery page is appearing correctly, however when I click on the thumbnails nothing happens. I can view the larger images if I use their direct path though. The JS Requirements path is correct and I could not find a SS_Navigator file to remove as suggested in another post. (Did that refer to the earlier version?)

    I am using WAMPSERVER on Windows XP.

    Thanks in advance for any tips!

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Lightbox not working Link to this post

    SS_Navigator file to remove as suggested in another post

    It wont be a file, it would be a $SSNavigator or something like that in the template - themes/blackcandy/templates/Page.ss . Do you get any JS errors in firebug?

  • evangogh
    Avatar
    Community Member
    4 Posts

    Re: Lightbox not working Link to this post

    I am receiving this: "Error: link has no properties
    Source File: http://localhost/silverstripe-v2.2.2/gallery/javascript/lightwindow.js
    Line: 557"

    Line 557: this.element.title = null ? '' : link.getAttribute('title');

    I did a full search of entire local site and could not find any references to $SS_Navigator or $SilverStripeNavigator.

    A previous post also suggested not including behaviour.js, but I am not sure from which file I need to remove "Requirements::javascript('jsparty/behaviour.js');" from.

    Thanks!

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Lightbox not working Link to this post

    All the JS for the gallery is probably loaded from gallery/code/GalleryPage.php ? Sometimes the JS versions will conflict as the gallery has its own version and the cms uses a slightly older version of prototype

  • evangogh
    Avatar
    Community Member
    4 Posts

    Re: Lightbox not working Link to this post

    Hmm...could not find any reference to behavior.js in any of the gallery/code PHP pages. Is there any way to fix this problem? Could I replace the Gallery prototype.js with the CMS prototype.js?

    Thanks!

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Lightbox not working Link to this post

    Ok Just got a lightbox working - gallery 0.2.2? or something + silverstripe 2.2.1, similar issue nothing happened when you clicked on the images.

    Solution? - well I had to use Requirements::block() for each of the SS JS files - seems like they were conflicting, dont know which one exactly or if its a order thing but I added this to gallerypage.php file in the function init()

    function init() {
       
          // Javascript Requirements
          
    // these are the old CMS js files that are breaking things
          Requirements::block("jsparty/scriptaculous.js");
          Requirements::block("jsparty/prototype.js");
          Requirements::block("jsparty/prototype_improvements.js");
          Requirements::block("jsparty/loader.js");
          Requirements::block("jsparty/behaviour.js");

    // just include the useful stuff
          Requirements::javascript( "gallery/javascript/prototype.js" );
          Requirements::javascript( "gallery/javascript/effects.js" );
          Requirements::javascript( "gallery/javascript/lightwindow.js" );

  • evangogh
    Avatar
    Community Member
    4 Posts

    Re: Lightbox not working Link to this post

    Well, the GalleryPage.php already had the new Requirements that you posted, willr. So what I finally did was revert back to silverstripe 2.2.1 (I had been using v2.2.2) and reinstall gallery 0.2.2. I then downloaded GalleryPage.php from the latest daily build and the lightbox finally worked!

    It took many hours of trial & error, but at least I finally have a functional gallery. willr, maybe you'd be able to figure out what is keeping the gallery from working with silverstripe 2.2.2? I'm perfectly happy with 2.2.1, but it might help future users.

    Thanks for all the help!

  • juandavidgc
    Avatar
    Community Member
    36 Posts

    Re: Lightbox not working Link to this post

    Hi!

    Well, i have a problem. I'm using the gallery module in my site, and i'm using too JQuery. I have been included this js Willr, buy the gallery didn't work. There are a problem with compatibilities with prototype-srciptaculos with jquery?

    thanks!

    4778 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.