Dashboard > blojsom 3.0 > ... > Plugins > Galleryr Plugin
  blojsom 3.0 Log In   View a printable version of the current page.  
  Galleryr Plugin
Added by Cliffano Subagio, last edited by Cliffano Subagio on Dec 23, 2007  (view change)
Labels: 

Availability

Galleryr Plugin v0.2 is available at Blojsom3 Plugins download page.

Description

Galleryr Plugin retrieves information of photos/photosets stored in Flickr. This plugin is useful for creating a simple a photo gallery.

Dependencies

Flickrj v1.0a8

Installation and Setup

Place galleryrplugin-x.y.jar and flickrapi-1.0a8.jar in /WEB-INF/lib/ directory.

Add the following to /WEB-INF/classes/blojsom-plugins.xml file.

<bean id="galleryr" class="com.mbledug.blojsom.plugin.galleryr.GalleryrPlugin" init-method="init" destroy-method="destroy"/>

Modify HTML plugin chain from Blojsom administration menu plugins->mappings
Add "galleryr" to one of the flavor-based plugin chains. You can place it anywhere within the chain, for example:

html ..., galleryr, ...

Configure Flickr API key from Blojsom administration menu weblog settings->properties->set property

Property Sample Value Description
flickr-apikey asdads7a9ds78ada You can apply for your API Key from Flickr

Usage

To add photos from Flickr to your blog, add either or both of the following meta data to your blog entry.

meta-galleryr-photos-id=31672038,31672718,31673083,31673749,31674479
meta-galleryr-photosets-id=31672038,31672718

The values are comma separated, you can put one or more, as many as you want.

Please note that the ID is not the title of the photo or the photoset. If you're not sure how to find out the ID, have a look at How to find out Flickr Photo ID and How to find out Flickr Photoset ID below.


Display Flickr photos by iterating through "galleryr-photos" entry meta data.
E.g. for asual theme, add the code below to asual-entry.vm template.

...
  #if ( $entry.getMetaData().get("galleryr-photos") )
    <p>
    #set ( $photos = $entry.getMetaData().get("galleryr-photos") )
    #foreach( $photo in $photos )
      <a href="$photo.getLargeUrl()" title="$!photo.getDescription()"><img id="photo-$photo.getId()" src="$photo.getSquareUrl()" alt="$!photo.getDescription()"/></a>
      &nbsp;
    #end
    </p>
  #end
  ...

Each photo is an instance of com.mbledug.blojsom.plugin.galleryr.GalleryrPhoto which wraps com.aetrion.flickr.photos.Photo object (retrievable using $photo.getFlickrPhoto()).

GalleryrPhoto provides several convenience methods:

  • getId()
  • getDescription()
  • getLargeUrl() - only for free account
  • getMediumUrl()
  • getOriginalUrl() - only for pro account
  • getSmallUrl()
  • getSquareUrl()
  • getThumbnailUrl()

Demo

Melbourne Photoblog uses Lightbox

Site running on a free Atlassian Confluence Open Source Project License granted to blojsom. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.4 Build:#809 Jun 12, 2007) - Bug/feature request - Contact Administrators