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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Widgets /

Discuss SilverStripe Widgets.

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

Flickr Widget

Go to End

6 Posts   2624 Views


Community Member, 79 Posts

8 August 2009 at 10:42pm

I am having trouble getting the Flickr widget to work, I have the Flickr module up and working, but the Flickr widget isn't showing in the blog module widgets section. Does anyone have this working? anyone have any advice?


Community Member, 57 Posts

9 August 2009 at 5:41am


Do you have other widgets working?
Have you selected the widget to appear in the Blog?
Are you calling $WidgetArea or whatever you have associated?



Community Member, 79 Posts

9 August 2009 at 6:02am

I have the youtube widget working, and the other standard ones that come with the blog. The Flickr one just isn't showing up in the admin screen under blog>widget at all.

Anyone have this working? Or can anyone pinpoint why this isnt working for me?


Community Member, 79 Posts

9 August 2009 at 8:08am

Edited: 09/08/2009 9:46am

Anyone got any ideas?
This just doesn't seem to be working for me. Not showing up in the widget tab at all


Community Member, 79 Posts

12 August 2009 at 2:18am

I have now tried a new install of the Blog module, the Flickr module, and a fresh install of Silverstripe, and still the Flickr widget isnt showing up in the Blog window.

I have also tried making it a seperate widget in the root install, tried adding it into the Blog, and still it isn't working. Does anyone have it working?


Community Member, 79 Posts

13 August 2009 at 4:48am

So I finally think I have found the answer to getting the Flickr Widget working, and I will post it here just in case anyone else has the same problem.

I was looking over the Widget Documentation at:

Which uses the Flickr Widget as an example, by pasting in this code instead of the one that comes with the Module, I managed to get it working. However, I did have to put back in some of the code from the module, as it was referencing the wrong files for the lightwindow.

See the code below for the working Flickr Widget.


class FlickrWidget extends Widget {
	static $db = array(
		"User" => "Varchar",
		"Photoset" => "Varchar",
		"Tags" => "Varchar",
		"NumberToShow" => "Int"
	static $defaults = array(
		"NumberToShow" => 8
	static $title = "Photos";
	static $cmsTitle = "Flickr Photos";
	static $description = "Shows flickr photos.";
	function Photos() {
      	if( $pos = strpos($_SERVER['HTTP_USER_AGENT'],'MSIE')) {
      		$version = substr( $_SERVER['HTTP_USER_AGENT'], $pos + 5, 3 );
      		if( $version < 7 ) {
		$flickr = new FlickrService();
		if($this->Photoset == "") {
			$photos = $flickr->getPhotos($this->Tags, $this->User, $this->NumberToShow, 1);
		} else {
			$photos = $flickr->getPhotoSet($this->Photoset, $this->User, $this->NumberToShow, 1);
		$output = new DataObjectSet();
		foreach($photos->PhotoItems as $photo) {
			$output->push(new ArrayData(array(
				"Title" => $photo->title,
				"Link" => "" . $photo->image_path .".jpg",
				"Image" => "" .$photo->image_path. "_s.jpg"
		return $output;
	function getCMSFields() {
		return new FieldSet(
			new TextField("User", "User"),
			new TextField("PhotoSet", "Photo Set"),
			new TextField("Tags", "Tags"),
			new NumericField("NumberToShow", "Number to Show")