Gallery Transformer
The Gallery transformer provides a simple Picture Gallery addition for Paloose.
Sitemap
The root sitemap needs to have the Gallery Transformer declared as a component:
<map:components>
<map:transformers default="xslt">
<map:transformer name="gallery" src="resource://lib/transforming/GalleryTransformer">
<map:parameter name="root" value="context://gallery/"/>
<map:parameter name="image-cache" value="context://resources/images/cache/"/>
<map:parameter name="max-thumbnail-width" value="150"/>
<map:parameter name="max-thumbnail-height" value="150"/>
<map:parameter name="resize" value="1"/>
<map:parameter name="max-width" value="600"/>
<map:parameter name="max-height" value="600"/>
</map:transformer>
...
</map:transformers>
where
- root — the root of the gallery (a
folder that holds the entire gallery). This can be overridden by the pipeline component,
or by an explicit declaration in the XML content (see below).
- image-cache — the cache where the
scaled image and the thumbnails are kept. In this case in the "resources/images/cache/" folder within the root of the site.
- max-thumbnail-width, max-thumbnail-height
— the size, in pixels, of the thumbnail image.
- max-width, max-height — the maximum
size, in pixels, of the displayed image. If either of the dimensions of the original
image exceed these values then a suitable scaling is applied to the cached
image.
- resize — should the original image
be scaled to the max values (1), or left as it is (0).
In order to use the transformer we need to put the following:
<map:match pattern="*.xml">
<map:generate src="context://content/{1}.xml"/>
<map:transform type="gallery"/>
<map:transform src="context://resources/transforms/gallery2html.xsl"/>
<map:serialize/>
</map:match>
Note that there is an XSL gallery transformer, gallery2html.xsl. An example and more details can be found on
the Gallery example page.
Copyright 2006 – 2023 Hugh Field-Richards. All Rights
Reserved.