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.

All other Modules

Discuss all other Modules here.

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

Working Gallery Plugin for SS 3


Reply

106 Posts   12141 Views

Avatar
arthurdent

15 July 2013 at 9:19am (Last edited: 15 July 2013 9:19am), Community Member, 166 Posts

Actually wondered later last night if it might be a stray GalleryPage.ss or GalleryPage.php causing grief. You nailed it OpticBlaze!! Thanks for all you help with this!!

Avatar
arthurdent

11 October 2013 at 4:29pm (Last edited: 11 October 2013 4:29pm), Community Member, 166 Posts

Well, it WAS working. Just about to upload to live server and the PrettyPhoto lightbox broke! Instead of back/forward arrows and Social Media stuff I get an image on a black page. Firebug tells me:


TypeError: $(...).prettyPhoto is not a function
   $("a[rel^='prettyPhoto']").prettyPhoto();

Anybody ever had this happen?

Avatar
Optic Blaze

11 October 2013 at 7:40pm Community Member, 162 Posts

Hi,

Sounds like the pretty photo jquery.prettyPhoto.js file is not executing. Did you check that it is loaded and that there are no jquery conflicts?

Avatar
arthurdent

11 October 2013 at 9:44pm Community Member, 166 Posts

Hi Optic Blaze! Yes, I can see prettyPhoto.js loaded and I was wondering if:

a) There was a conflict with another script; or
b) I needed lo load it sooner/later

Think what happened was it stopped working once I added a responsive function to the site -- unfortunately don't know of any potential conflict. I now see that I also have jquery.min.js and jquery-1.7.1min.js. Just turned off 1.7.1 but problem not resolved -- and it threw a couple more errors.

Will keep on looking. Thanks for the tip!

Avatar
Optic Blaze

11 October 2013 at 10:06pm Community Member, 162 Posts

Sounds like you are on the right track:

Try commenting out this line in the SS3 gallery module located in the GalleryPage.php file:

//Requirements::javascript('ss3Gallery/js/jquery-1.7.1.min.js');

You responsive design's jquery version should then take over which would hopefully sort out the conflict

Avatar
arthurdent

12 October 2013 at 7:15am Community Member, 166 Posts

Thanks but that didn't do it...

Did generate a couple more errors though:

TypeError: Object.extend is not a function
   }, window.LightboxOptions || {});

lightb...5125063 (line 63)
ReferenceError: Prototype is not defined
   linear: Prototype.K,
effect...5125063 (line 73)

TypeError: $(...).prettyPhoto is not a function
   $("a[rel^='prettyPhoto']").prettyPhoto();

... which doesn't mean a whole lot to me at this stage but I'll keep fiddling...

Avatar
arthurdent

12 October 2013 at 8:39am Community Member, 166 Posts

OK - I nailed the culprit:

<% require javascript(http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js) %>

This is part of the responsive design. It means on smaller devices the navigation panel folds away into a bar at the top of the screen until it's needed... now wondering what to do as a workaround?

Avatar
arthurdent

12 October 2013 at 8:47am Community Member, 166 Posts

OK. So the version of jquery I'm downloading is 1.9.1

The version included in SilverStripe (Third Party directory) is 1.7.2

I'm wondering if they are mutually exclusive?