 | Gallery Plugin Not Available
The original author of the Gallery plugin has not been available to maintain the plugin. You may check out the Galleryr Plugin as an alternative. |
Description
This plugin provides a very simple mechanism for adding links to photos in a Gallery
website. It is a work-a-like copy of the Gallery Link Plugin
for Movable Type.
Installation and Setup
The Gallery plugin can be downloaded here
.
In your global /WEB-INF/plugin.properties file, add the following line:
gallery=org.carbonite.blojsom.plugin.gallery.GalleryPlugin
You may then add "gallery" to one of the flavor-based plugin chains. These plugin chains can be found in the individual user's plugin.properties file. For example:
html.blojsom-plugin-chain=..., gallery
The Gallery plugin has its own configuration file, gallery.properties, that is referenced in /WEB-INF/web.xml.
The gallery.properties file will be located in the respective /WEB-INF/(blog-id) directory, and contains the following key-value pairs:
gallery-base-url=http://www.example.com/~user/gallery/
album-base-url=http://www.example.com/~user/albums/
random-photos-file=/home/user/public_html/photos.txt
img-class=img-class
link-class=link-class
The gallery-base-url property should be the URL to the Gallery installation.
The album-base-url property should be the URL to the directory where the albums are stored on the server.
These two properties are required to get any functionality out of this plugin.
The random-photos-file property should point to a file containing the list of photos you want to be selected from at random. The optional img-class and link-class properties should be CSS classes you want added to the HTML that will be generated.
Usage and URL Parameters
Usage
This plugin lets you use a '<gallery>' tag in your individual blog posts that will be converted to an image thumbnail that is a link to the image in your Gallery setup. For example, this tag:
<gallery photo="crossroads04/DSC01405">
will result in the follwing HTML when converted by the plugin:
To create a link to a random photo, make a file that the server has access to containing a list of photos to pick from, one line per photo. They should be in 'album/filename' format, just like in the '<gallery>' tag:
crossroads04/DSC01405
crossroads04/DSC01259_1
crossroads04/DSC01276_1
Then, call the 'randomPhoto' method in your Velocity template to generate a random link to a photo in the list.
Context Attributes and Types
The following table describes the context attributes that are available and their associated type.
| Context key |
Input or Output |
Type |
Description |
| BLOJSOM_PLUGIN_GALLERY_HELPER |
Output |
org.carbonite.blojsom.plugin.gallery.GalleryHelper |
You may then make use of the 'randomPhoto' method in your templates. It will generate a link to a random photo in the list of photos you specified in the 'gallery.properties' file. |