Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive /

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

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

Gallery - lightwindow porblems


Go to End
Reply


10 Posts   7225 Views

Avatar
plomar

6 Posts

18 October 2007 at 12:33am

Edited: 18/10/2007 12:45am

Hi,

I have a problem with my gallery, when I open my gallery page everything looks OK, thumbnails, pagination ..., but when i click on the thumbnail image nothing happened, my firebug plugin tell me about an error:
link has no properties
http://localhost:3000/gallery/javascript/lightwindow.js
Line 557

What can I do?

Regards,
Marko

P.S. sorry about my english

Avatar
plomar

6 Posts

19 October 2007 at 8:30am

Edited: 19/10/2007 8:31am

I solve the problem!
Lightwindow doesn't work on local computer because of

$SilverStripeNavigator

, when I remove it everything works great.

Thx!

Avatar
Fuzz10

Community Member, 787 Posts

10 December 2007 at 5:14am

Currently having the exact same problem, but removing the navigation bar doesn't work for me.

I'm pretty keen on fixing this , because this module looks awesome !

Anyone has an idea ?

Avatar
Fuzz10

Community Member, 787 Posts

10 December 2007 at 5:19am

Ah.. Figured it out..

Behaviour.js is also conflicting with gallery.

So , in short :

- Turn off the SS navigator
- Do not include behaviour.js

Avatar
dewoob

Community Member, 10 Posts

30 August 2008 at 10:42am

Edited: 30/08/2008 10:51am

Aah, thanks a lot for posting your solutions! I've been struggling with the gallery almost all day long...

After reading your posts, I did something like this:

Page.php:

function ThisIsNotAGalleryPage() {
return !( $this instanceof GalleryPage );
}

Page.ss:

<% if ThisIsNotAGalleryPage %>
$SilverStripeNavigator
<% end_if %>

Just a stupid band-aid, of course, but seems to work so far...

I'd like to say that those conflicts REALLY AREN'T funny! As soon as you add a feature that needs some javascript, some different versions of a library may be included at the same time. How shall I ever implement a gallery that supports comments, for example?

Avatar
Willr

Forum Moderator, 5513 Posts

30 August 2008 at 11:03am

Comments should work without JS. They will just default back to standard PHP processing rather then the fancy AJAX commenting system. Forms also will just use Server side validation rather then client side and serverside if you disable the behavior.

This will be fixed for good once the JS rewrite of the system is complete / we start to see it merged back to trunk, Hopefully it will tidy up things like the gallery etc by using a more up to date library / better JS support and control

Avatar
dewoob

Community Member, 10 Posts

30 August 2008 at 11:34am

OK, comments and forms work without JS. In fact, even the gallery does, opening every image in its own browser window. The problem is that the gallery will not work as soon as two versions of prototype.js are included, with one being not compatible with lightwindow (e.g. because the version from jsparty doesn't support Prototype.BrowserFeatures).

At this moment, I guess I cannot "choose" to grant AJAX capabilities to the gallery, but use traditional processing for forms and comments, right? I would have to hack silverstripe so that it doesn't include any JS for comments and forms on gallery pages, in order to keep the Javascript "clean" and the gallery working. Is there a simple way to do this?

I'm looking forward to the JS rewrite.

Avatar
Willr

Forum Moderator, 5513 Posts

30 August 2008 at 11:43am

This is what I did to get it to work on a recent client site

gallery/code/GalleryPage.php

function init() {
   
      // Javascript Requirements - Block the standard JS. Include Gallery JS.
      
      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");
      Requirements::javascript( "gallery/javascript/prototype.js" );
      Requirements::javascript( "gallery/javascript/effects.js" );
      Requirements::javascript( "gallery/javascript/lightwindow.js" );
      parent::init();
}

Go to Top