Recent Changes
Recent Changes · Search:

Templates: How do I customise a metadata template

Explain how to control the metadata settings in the template pages. What exactly do I have to do to change the default behaviour?

A floral border (15th century)

Print layout is controlled through metadata settings whose default values are defined on various template pages in the Site group. Tip 00017 described how this works and gave a few illustrative examples. It explained how an author can control printed behaviour in 3 complementary ways:

  1. per page, by adding qualifiers to a (:typeset:) directive
  2. per group, by creating one or more Group template pages
  3. site-wide, by editing one or more of the Site template pages

This tip looks at the first option, per page customisation, in more detail. Let us use an example to illustrate exactly how to over-ride the default print layout settings, as defined on the Site template pages. Suppose we want to change 3 of the default settings:

  • treatment of hyperlinks
  • treatment of images
  • treatment of floats

Referring to Site.Print Template (the page controlling the layout of single page PDF requests) shows us the configuration settings described in Changing the metdata for one page.

Metadata nameValue optionsMeaning
colorlinkscheck oncheckbox with default off
imagesize*regular;small;sidecaps|side captions;rotate|allow rotationradio buttons with default regular
floatherefigures;tables;cfloats|custom floats;on|all floats;*offradio buttons with default off

We wish to generate a PDF of the page with coloured hyperlink text, side captions on images, and float tables “here” if they will fit. Example of per-page metadata shows how to do this.

Example of per-page metadata
(:typeset-page colorlinks=on imagesize=sidecaps floathere=tables:)

PDF settings (show)

The imagesize template entry reads “sidecaps|side captions” — this needs an explanation. It tells the wikiforms processor to use “sidecaps” as the radio button value and “side captions” as the display text for that button. So we need to set the value in our typeset directive.

Once we have set the values for the page, a reader cannot over-ride them. Press the PDF options button and notice that these 3 values are fixed and cannot be changed.

Category: metadata

« 00049 · Edit Form · 00051 »

Page last modified on 16 January 2009 at 08:57 PM