Template Codes

Name of Individual (or He/She)

Code: {individual}

Will be replaced by the name of the individual or ‘he’ or ‘she’, depending on the context.

Name of Individual (or Him/Her)

Code: {individual/him/her}

Will be replaced by the name of the individual or ‘him’ or ‘her’, depending on the context.

Name of Individual (or His/Her)

Code: {individual's}

Will be replaced by the name of the individual or ‘his’ or ‘her’, depending on the context.

Him/Her

Code: {him/her}

Will be replaced by ‘him’ or ‘her’, depending on the sex of the individual.

His/Her

Code: {his/her}

Will be replaced by ‘his’ or ‘her’, depending on the sex of the individual.

Name of Spouse (or Her/Him)

Code: {spouse/him/her}

Used with family facts. Will be replaced by the name of the individual’s spouse or ‘her’ or ‘him’, depending on the context.

Names of Couple (or They)

Code: {couple}

Used with family facts. Will be replaced by the names of the two participants in a family fact (e.g. marriage), or by ‘they’, depending on the context.

Date

Code: {date}

Will insert the date in a text format, with an appropriate prefix. For example, if the date is an exact day, the prefix will be ‘on’ (e.g. on “30th January, 2001”). If the date is a month or year, the prefix will be ‘in’ (e.g. in 1998). If the date is a range or a period, again appropriate prefixes will be used.

Unlike all other template codes, the date code can be qualified to specify a particular date format. See Advanced Features of Template Codes below.

Place (with prefix 'in')

Code: {place}

Inserts the place name (usually in the ‘Tidy’ format where repeated commas are reduced to a single comma), with the prefix ‘in’.

Tip: In narrative reports you can opt to only use the first part of a place name when replacing template codes for places, if that particular place has already been mentioned in full earlier in the same section. This avoids unnecessary repetition of information and is enabled by default. See the Use Short Form for Repeated Place Names option in the Main tab of the Options dialog for the narrative report in question.

Place (with no prefix)

Code: {_place}

Inserts the place name (usually in the ‘Tidy’ format where repeated commas are reduced to a single comma), with no prefix. If you want a prefix, but just don’t want ‘in’, see How to Add a Prefix or Suffix to Any Template Code below.

Secondary Place

Code: {_place2}

Used with immigration and emigration events only as each of these, unlike all other fact types, are associated with 2 places: the place the person immigrated to and the place they emigrated from. This code causes the secondary place to be inserted.

Cause

Code: {cause}

Inserts the cause, if any, associated with the relevant fact.

Note

Code: {note}

Inserts the note, if any, associated with the relevant fact.

Address

Code: {address}

Inserts the address, if any, associated with the relevant fact.

Tip: see How to Add a Prefix or Suffix to Any Template Code below, for suggestions about how to add a prefix to an address.

Fact Label (e.g. 'Occupation')

Code: {label}

Inserts the fact label (e.g. ‘Occupation’).

Fact Value (e.g. 'Accountant')

Code: {value}

Only used with attributes. Inserts the fact value prefixed by ‘a’ if the value begins with a vowel (e.g. ‘a sailor’) or by ‘an’ if the value begins with a consonant (e.g. ‘an airman’).

Fact Value (with a/an prefix)

Code: {a/an value}

Only used with attributes. Inserts the fact value prefixed by ‘a’ if the value begins with a consonant (e.g. ‘a sailor’) or by ‘an’ if the value begins with a vowel (e.g. ‘an airman’).

Abbreviation

Code: {abbr}

Will be replaced by the fact abbreviation if there is one, or the fact label if there isn’t.

'Child' or 'Children'

Code: {‘children’}

Used with the ‘Count of Children’ field only. Is replaced by the word ‘child’ if the person had 1 child only. Otherwise it is replaced by the word ‘children’.

'Spouse' or 'Spouses'

Code: {‘spouses’}

Used with the ‘Count of Spouses’ field only. Is replaced by the word ‘spouse if the person had 1 spouse only. Otherwise it is replaced by the word ‘spouses’.

Advanced Features of Template Codes

How to Use a Specific Data Format

The {date} template code is unique amongst all other template codes, in that it alone can be qualified to specify a particular required format. To qualify the date code, add a colon followed by the qualifer. For example, the code {date:YEAR} will return the year part (only) of the date. The code {date:ABBREV3} will return the date in ABBREV3 format. The code {date:DAY_OF_WEEK} will return the day of the week of the date. See Date Formats for a complete list of qualifiers and the date formats they produce.

Please note that the simple {date} code automatically adds various prefixes (different ones depending on the date type) and other language elements, to make the date information fit correctly into a narrative sentence. When you qualify a date, no such additional language elements are added. If you want prefixes, you will have to add them yourself (see next).

How to Add a Prefix or Suffix to Any Template Code

If a given field has no value the template code will be simply removed from the sentence that is output, without being replaced by anything.

For example, if you had a template: “{individual} was born at {address} {date}”, and you had no address information for John Smith, the sentence generated for his birth event might be, say,

John Smith was born at on 19th January, 1903.

Notice the unwanted occurrence of the word 'at'. To avoid this happening you need to attach the ‘at’ to the address as a prefix, so that it only appears when there is an address. You do this by putting angle brackets <> around the template code. Any text within the angle brackets will only be output if the template code is not empty. So for example, if you changed the template code to

{individual} was born <at {address}> {date}

the sentence generated would be

John Smith was born on 19th January, 1903.

and the unwanted ‘at’ would no longer appear.

You can use this technique to add a prefix and/or suffix to any template code.

The CHM file was converted to HTML by chm2web software.