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:
Configure Flickr API key from Blojsom administration menu weblog settings->properties->set property
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>
#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