ICode! Launch!

Skip to Contents | Log in

Home

Asides

It's really hard to design products by focus groups. A lot of times, people don't know what they want until you show it to them -- Steve Jobs, BusinessWeek, May 25 1998 # Closing Quote

What's New?

Silverstripe and Flickr

We recently developed a site with Silverstripe 2.3 and encountered two issues with the Flickr module.

1 - Error in Flickr Gallery. The gallery would not work and the page is broken with an error message that currentURLSegment does not exist, referencing line ~165 in FlickrService.php (flickrservice/code/FlickrService.php).

The fix was straightforward after perusing some of the forums as many people have encountered this error.

Change
$current_url = Director::currentURLSegment();
to
$current_url = Controller::curr()->URLSegment;

2 - Light box does not work. Clicking the image, does not render a popup, but redirects to a new page with the image.
There is a conflict between the two prototype includes: jsparty/prototype.js and flickrservice/javascript/prototype.js. The gallery includes the jsparty prototype for commenting. I turned off commenting, but the jsparty prototype js file was still included.

In FlickrGallery.php, i block the jsparty/prototype include.

In FlickrGallery.php, find the init() function (line ~82) and add the following:
Requirements::block("jsparty/prototype.js");

This resolves the prototype conflict issue and the lightbox feature should work.

These are both band aid fixes and I hope that future improvements to Silverstripe
will address this. Silverstripe is still a wonderful framework for web development
and we will continue to use it.

We recently launched a client site using Silverstripe and Flickr and here it is at:
Andrew Field Music.

CSS Template by Rambling Soul | WordPress Theme by Theme Lab and Online Marketing | Valid XHTML 1.0 | CSS 2.0