Publication patterns: Templates
Templates define how values from the enumeration and chronology labels are used to create a human readable label for each issue that will be generated by the publication pattern.
Writing a templates requires you to know to include the appropriate values from each chronology and enumeration label you have setup. To use a value from an enumeration or chronology in the template, you will need to put a token in double curly braces in the template. The token will identify which enumeration or chronology label is being used, and which part of the label is being used.
All other text in the template (i.e. text not in double curly braces) will be treated as simple text that should be included. For example a simple template that would generate just the month and year for a label could look like:
{{chronology1.month}} {{chronology1.year}}
Which would lead to an output like January 2024
. The space between the two tokens in the template is important as it ensures there is a space between the month and year in the display summaries that are created.
Tokens
When you add an enumeration or chronology to the list of labels in the publication it is allocated a unique numbered name:
The first enumeration label you add is
enumeration1
, the second enumeration label you add isenumeration2
etc.The first chronology label you add is
chronology1
. Usually only one chronology label is required but if a second chronology label is added it ischronology2
etc.
This numbered name is always the first part of any token you use in the template. The second part of a code is used to identify a particular part of the enumeration or chronology to use. There is a list of special values for these:
Type of label | Part of label | Token example |
---|---|---|
Chronology | Weekday | {{chronology1.weekday}} |
Chronology | Month day | {{chronology1.monthDay}} |
Chronology | Month | {{chronology1.month}} |
Chronology | Year | {{chronology1.year}} |
Enumeration (numeric) | Level 1 number | {{enumeration1.level1}} |
Enumeration (numeric) | Level 2 number | {{enumeration1.level2}} |
Enumeration (numeric) | Level n number | {{enumeration1.leveln}} |
Enumeration (textual) | Value | {{enumeration1}} |
All the examples in the table above use chronology1
or enumeration1
which means they refer to the first chronology or enumeration label defined. To use values from the second or third or whatever label, simply increase the number on the end to the appropriate value.
To take an example, here is a set of labels (one chronology and two enumeration) with the tokens that would be used for each part:
Given these labels a valid template might be:
no.{{enumeration2.level1}}=v.{{enumeration1.level1}}:{{enumeration1.level2}}({{chronology1.year}}:{{chronology1.month}}. {{chronology1.monthDay}})
This would indicate that each piece had two numbers - one from enumeration2
(the second enumeration label) which defines a single continuous numbering sequence, and then a volume/issue combination which comes from enumeration1
(the first enumeration label). Additionally each issue has the date written as year: month day
which would produce a value like: 2023: Dec. 25
.
This example has been specifically chosen for its complexity to demonstrate many different tokens being used. Many templates will be simpler than this using only one chronology label and one enumeration label (or even a single label of one type or the other)