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 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.

METHODS

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

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

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

Upgrades $file (which should be a Daizu::File object) to include the information necessary for publishing the file as an article. Creates an article 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/