Publication template replacement tags
   compleat botanica    using the software    Publishing   
 
 
   

 

Replacement tags

Replacement tags inside publishing templates take the form <cb:TagName>.  As the publication parser encounters a replacement tag, it looks up the current value for the tag and inserts it into the output file.  For example, if the current specimen record being processed is number "S101" and the genus and species are "Alchemilla", and "mollis" the parser would make these substitutions:

 

<html>
  <body>
    Specimen Number <cb:SpecimenNumber>
    Specimen Name <cb:Genus> <cb:Species>
  </body>
</html>

<html>
  <body>
    Specimen Number S101
    Specimen Name Alchemilla mollis
  </body>
</html>

Template with replacement tags Output file
 

Attributes

Replacement tags can accept attributes.  Attributes are paired values that take the form <cb:TagName attribute="value">.  Each replacement tag recognizes certain attributes, and ignores all others.  For example, many tags understand the attributes "text" and "graphics", both of which can take the values "on" or "off".  Thus the replacement tag <cb:Propagule> might take several forms in the template as shown in the table below (where the current specimen's value for propagule is "Gemmate").

Template file Output file Browser
<cb:Propagule text="on" graphics="on"> <img src="./images/6313.jpg"> Gemmate  Gemmate
<cb:Propagule text="on" graphics="off"> Gemmate Gemmate
<cb:Propagule text="off" graphics="on"> <img src="./images/6313.jpg">
<cb:Propagule text="off" graphics="off">

Table of replacement tags

By default, each replacement tag assumes that certain attributes are "on" even when they are not explicitly specified.  For a listing of these defaults see the Alphabetical index to column specifications.

Table of attributes

The meaning of on and off for each attribute is explained in this table.

Attribute on off
text Display the data field in text form. Do not display the data field in text form.
graphics For RHS colors and fields which use colors to represent codes, such as the climate fields, display a rectangular color patch.

For fields which have an iconic representation, display the icon.

For fields which are represented by a checkbox, display a checked or unchecked graphic of a checkbox.

For the Picture field, display the picture.

Do not display any embedded graphics for this field.

 

For checkboxes, display the value as "yes" or "no".

For the picture field, display the picture filename.

code For fields which use colors to represent codes, display the color patch with the code on top. Do not display the code on the color patch.
plaintext For the BotanicalName field only, display the field without italics. For the BotanicalName field only, display the field in proper botanical name format.
richtext For the notes fields, display the text using the fonts and colors as they were applied by the user in the notes editors. For the notes fields, display the text string using the fonts and colors as specified in the publication template and style sheets.
thumbnail For the picture field, make a copy of the picture file compressing its filesize to match the display size of the picture.  This option is best for Web pages. For the picture field, make a full sized copy of the picture file retaining its original composition quality.  This option will increase Web page display times.

The picture field can also accept optional width and height attributes.  If one of the width or height attributes is present the picture will be scaled to the specified width or height.  If both are present, the picture will loose its aspect ratio.  If neither are specified and the thumbnail attribute is on, the picture is displayed with a height of 60.

Additional replacement tags

In addition to the replacement tags which directly correspond to database fields, there are replacement tags which allow the template designer to embed hyperlinks and special values as well as replacement tags which are used to control repetition and accumulation.

Hyperlink
replacement tag
Description
<cb:PrevPage> This tag is replaced with a hyperlink to the previous document in the publication.
<cb:NextPage> This tag is replaced with a hyperlink to the next document in the publication.
<cb:IndexPage> This tag is replaced with a hyperlink from the current detail page to the summary table of all specimen.
<cb:DetailPage> This tag is replaced with a hyperlink from the summary table of all specimen to a particular detail page.
Each of these hyperlink replacement tags can accept the linktext attribute.  This attribute is used to define what text to display for the hyperlink.  For example to display the botanical name in the hyperlink from a summary table to a detail page you would code the tag as: <cb:DetailPage linktext="cb:BotanicalName">

 

Special value
replacement tag
Description
<cb:CurrentFilter> Replaced with the name of the current filter used for the publication.
<cb:PageNumber> Replaced with the current page number for detail page templates, and the current item in the specimen list for summary table templates.
<cb:PageCount> Replaced with the total number of specimen records published.

 

Repetition
replacement tag
Description
<cb:Specimen>

</cb:Specimen>

Everything between the opening and closing tags is repeated for each specimen in the publication.
<cb:Column>

</cb:Column>

Everything between the opening and closing tags is repeated for each data field in the current filter.

This replacement pair is usually placed within a <cb:Specimen></cb:Specimen> pair.

<cb:HeaderValue> Replaced with the name of the current column.

For example, to create a list of all data field names in the current filter, the template would look like this:

<cb:Column>
  <cb:HeaderValue>
  <p>
</cb:Column>

This replacement tag only has meaning when placed within a <cb:Column></cb:Column> pair.

<cb:ColumnValue> Replaced with the value of the current column.

For example, to create a table of all data field values in the current filter, the template would look like this:

<table>
  <tr>
    <td>
      <cb:Column>
        <cb:ColumnValue>
      </cb:Column>
    </td>
  </tr>
</table>

This replacement tag only has meaning when placed within a <cb:Column></cb:Column> pair.

 

Accumulation
replacement tag
Description
<cb:Repeat>

</cb:Repeat>

The text between these two tags is inserted when the requested number of specimen has been reached.  Use the every attribute to request how often to trigger this insertion.

For example, to insert a paragraph break after every fourth specimen the template would look like:

<cb:Specimen>
  . . .
  . . .
  <cb:Repeat every="4"><p></cb:Repeat>
</cb:Specimen>

This replacement pair only has meaning when placed within a <cb:Specimen></cb:Specimen> pair.

<cb:Store>

</cb:Store>

Everything between the opening and closing tags is accumulated, but not copied to the output file, until the next <cb:Release> tag is encountered.
<cb:Release> Everything accumulated by the <cb:Store></cb:Store> pair is copied to the output file.

For example, to copy the botanical names to the output file in groups of 5, with a line break every 5th specimen, the template would look like:

<cb:Specimen>

  <cb:Store>
    <cb:BotanicalName>
  </cb:Store>

  <cb:Repeat every="5">
    <cb:Release>
    <hr>
  </cb:Repeat>

</cb:Specimen>

See also

   Step-by-step guide to publishing

   The publish previewer

   How the publishing parser works

   Publication style sheets

   Publishing your data

Last reviewed March 25, 2004   

 

  Order your copy here