The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Daizu::Plugin::PictureArticle - publish image files as articles

DESCRIPTION

This plugin allows you to mark an image file as being an article (by setting its daizu:type property to article as normal). When it is published a normal article HTML page will be generated with the title, description, and so on from the image file's properties. The image itself will also be published and included in the page. If the image is too big then an additional scaled down 'thumbnail' image will be generated and included in the page, and will be linked to the full size original version.

This example page was generated using this plugin:

http://www.daizucms.org/blog/2006/09/pickled-cucumber/

This plugin will be triggered for any article with a MIME type (according to the file's svn:mime-type property) where the first part is image, for example image/jpeg.

CONFIGURATION

To turn on this plugin, include the following in your Daizu CMS configuration file:

    <plugin class="Daizu::Plugin::PictureArticle" />

By default it will ensure that the image included in the page will not be more than 600 pixels wide or 600 pixels high. The thumbnail image will have the suffix -thm added to its URL just before the file extension. You can change these settings in the configuration file as follows:

    <plugin class="Daizu::Plugin::PictureArticle">
     <thumbnail max-width="400" min-height="400"
                filename-suffix="-small"/>
    </plugin>

This example limits included images to 400 pixels on a side, and will use -small as the suffix on the filename.

If the thumbnail element is present at all then the max-width and max-height values will default to unlimited size. This means that you can specify a maximum width but leave the height unbounded.

You can use different configuration for different websites, or parts of websites, by providing multiple plugin elements in the configuration file: a default one and others in config elements with paths.

PROPERTIES

These are the Subversion properties which you can set on your image file when using this plugin:

daizu:type

Required. You must set this to article or the file will just be published as an 'unprocessed' file (a normal image rather than a web page).

svn:mime-type

Required. This should be something like image/jpeg or image/png.

dc:title

Required. The title of the article.

dc:description

Optional, but recommended. A textual description which will be published alongside the image.

daizu:alt

Optional. Text to put in the image's alt attribute in the web page. If this isn't present then an empty alt attribute will be used.

METHODS

Daizu::Plugin::PictureArticle->register($cms, $whole_config, $plugin_config, $path)

Called by Daizu CMS when the plugin is registered. It registers the load_article() method as an article loader for all MIME types like 'image/*'.

$self->load_article($cms, $file)

Returns article content and metadata for $file (which should be a Daizu::File object). The article content returned is a document to contain the picture, or a thumbnail of it if it is too big.

Never rejects a file, and therefore always returns true.

COPYRIGHT

This software is copyright 2006 Geoff Richards <geoff@laxan.com>. For licensing information see this page:

http://www.daizucms.org/license/