Daizu::Plugin::PictureArticle - publish image files as articles
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.
daizu:type
article
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.
svn:mime-type
image
image/jpeg
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.
thumbnail
max-width
max-height
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.
plugin
config
These are the Subversion properties which you can set on your image file when using this plugin:
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).
Required. This should be something like image/jpeg or image/png.
image/png
Required. The title of the article.
Optional, but recommended. A textual description which will be published alongside the image.
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.
alt
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/*'.
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.
$file
Never rejects a file, and therefore always returns true.
This software is copyright 2006 Geoff Richards <geoff@laxan.com>. For licensing information see this page:
http://www.daizucms.org/license/
To install Daizu, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Daizu
CPAN shell
perl -MCPAN -e shell install Daizu
For more information on module installation, please visit the detailed CPAN module installation guide.