Narrative Report Fact Sentence Templates

Introduction

Sentence Templates are defined in the Tools > Fact Types dialogues to specify the default wording in Narrative Reports and elsewhere. They can also be defined for specific Facts in the Property Box Dialogue Facts tab by editing the Sentence field.

Family Historian (fh) V6 added significant features to enhance Sentence Templates as described below.

If Custom Facts are imported from other products there may be no associated Sentence Template as there is no Fact Definition, so follow the advice in Work with Fact Sets/Fact Types under Custom Facts from other Products.

Family Historian (fh) V6 added a special custom Fact Set primarily for FTM migrants, but it can be used by anyone. Select the Extended Set from the Fact Set drop list, and follow the popup instructions to reveal its details.

Finding Sentence Templates

Sentence Templates can be found in various dialogues to define either default fact sentences or specific fact sentences.

Default Fact Definitions

These Sentence Template definitions are applied by default to all Facts of the same type.

Use Tools > Fact Types, or from the Property Box Dialogue Facts tab use Add Fact > More Fact Types > More>>. Then select the Fact and click Edit (or Properties) to open the Fact Definition dialogue, where the Help button offers advice about the Sentence Template field.

In the Fact Definition dialogue, since fh V6, click the witness Roles button, select a Role and use Edit, or the Add button, to open the Edit/New Role dialogue, where the Help button has advice about the Witness Sentence Template field.

In any of the above above dialogues, click the Advanced button to reveal Override Templates for the Property Box Dialogue Facts tab and the Records Window.

The <<Insert Code button offers the same features in all the above dialogues, as explained later.

Use the Installation Settings button or Old Versions button to restore earlier templates.

See the Alternative Sentence Templates below for examples of various sentence styles.

Default Sentence Templates

Tip: If you intend to extensively modify the default Sentence Template definitions for many Facts, then it is advisable to use the Fact Sets button and Clone the appropriate fact set, especially the Standard set. That allows the two alternative definition styles to be easily swapped via the Fact Set priority order. Such scenarios could include creating a fact list style or a foreign language style.

Specific Fact Sentences

These Sentence Template definitions apply to just one specific Fact sentence to override the default.

In the Property Box Dialogue Facts tab, select a Fact to display its Sentence template field.

Since fh V6 in the Facts tab, right-click a Fact and choose Witnesses. Select a Witness to display that Witness Sentence template field, and click Help for advice.

If the field background is beige, then the default template applies. Click on the field to edit the template for that specific instance, and the background changes to white. Unfortunately, there is no <<Insert Code button to help compose the template. To restore the default template, delete the entire contents of the field.

Specific Sentence Templates

Standard Template Codes

Most of the Standard Codes are simple names enclosed in curly brackets, such as {individual} or {date} that represent the Name of Individual or the Date field respectively. They can be inserted from the <<Insert Code button, and for full details choose the How to Use Advanced Features option and scroll up the Help page. If the Fact field associated with a Code is empty, then nothing appears in the Sentence.

fh V6 added new codes for witnesses and formatting. The Witness Role Codes apply to witnesses associated with a fact, the Formatting Codes of <br> and <para> force a New Line or New Paragraph, and the special {blank} code inhibits the sentence completely. See the Alternative Sentence Templates below for examples of their use.

Advanced Template Codes

Most of the Advanced Codes are not available from the <<Insert Code button, so for full details choose the How to Use Advanced Features option and scroll down the Help page. Such Codes must be edited manually into the Sentence Template taking care to avoid syntax errors, which are evident because the Code appears in the Sentence instead of the desired text.

The {date} code automatically adds prefixes and other elements to make the Date fit into the Sentence, and is unique in allowing Date Qualifiers such as {date:YEAR} but they inhibit the automatic prefixes, etc.

It is often useful to add a prefix/suffix to a Code such as at {address}, but if the Fact field is empty the prefix/suffix still appears, unless it is made conditional by enclosing the structure in angle brackets such as <at {address}, >. This is similar to the {=CombineText("at ",%FACT.ADDR%,", ",,)} function. See the Alternative Sentence Templates below for examples of this.

Data References & Functions

Since fh V6 both Data References and Functions can be inserted into Sentence Templates within curly brackets such as {%FACT.PLAC>LATLONG%} or {=TextPart(%FACT.PLAC%,1,2,TIDY)}.

Use the <<Insert Code > Data Reference option to open the Data Reference Assistant dialogue that helps compose the Codes. There are special Contextual Data References that provide links to the Individuals and Witnesses associated with a Fact.

Functions must be edited manually into the Sentence Template taking care to avoid syntax errors, which are evident because the Function Code appears in the Sentence instead of the desired text.

Unfortunately, Standard Template Codes are NOT recognised within Functions so {=TextIf(Exists({date}),{date}," at unknown date")} is not possible as explained in Wish List Ref 546 Enhanced use of Narrative Template Codes. However, it may be possible to substitute a Data Reference such as %FACT.NOTE2% instead of {note}.

Custom Fact Fields

Custom fields cannot be added to Facts, and even if they could, when exported in GEDCOM they would NOT be recognised by other genealogy products.

However, when designing a Custom Fact and just one extra field is needed, then instead of an Event try using an Attribute, which offers a value field after its name in the Facts tab, and is referenced by the {value} code in its Sentence Template.

Otherwise, the best solution uses labelled meta-fields in the Note field, such as for a Baptism Event: Baptism Fact Note Labelled Text Where the following Function Codes would compose the necessary Sentence text:
<by the {=GetLabelledText(%FACT.NOTE2%,"Minister: ")} >
<for a fee of {=GetLabelledText(%FACT.NOTE2%,"Charge: ")} >

Each labelled meta-field can be included or excluded in any combination desired.

This not only allows the details to be exported satisfactorily in GEDCOM, but also allows other Note text not required in the Sentence, unlike the {note} code that would include it all.

It is advisable to enclose the meta-fields in privacy [[ brackets ]] to allow the fields or the brackets to be excluded from Reports and also the {note} code.

There is a handy feature via the Advanced button for Override Templates mentioned above. It offers an Auto-Create Note field that can hold the meta-field Note labels, so they automatically get created whenever that Fact is added. To start each label on a new line use Ctrl+Enter to insert a line break.

Alternatively, the Source Note field %FACT.SOUR2% can be used in exactly the same way but rather less obtrusively. It is a local Note that appears in the yellow Sources For pane, but is nothing to do with Source records. The way to add a Source Note is via the All tab. Right-click the Fact and choose Add Source > Add Source Note to this Record. Add the text to the Source Note and it will appear in the Sources For pane. To edit the text use the All tab again and expand the Fact to reveal the Source Note box. However, such Source Note fields will appear in the Sources section of Reports, and even if excluded by enclosing in privacy [[ brackets ]] the cross-reference numbers will still exist.

Alternative Sentence Templates

The default Sentence Templates are often repetitive and in a single paragraph. The following alternatives offer other sentence styles, typically using a new line <br> or paragraph <para> code. Each Template can be pasted into the Sentence Template field of any appropriate fact to yield a Sentence similar to the examples shown below.

Tabulated Facts

This mimics the Individual Summary Report tabulated style, and can be applied to most fact and witness templates. Explicit tab & space characters can follow the colon (:) on each new line, such that the text is neatly tabulated in the report. The number of tab characters may need adjusting for each line, or could be omitted altogether. The new paragraph <para> code is best located at the end of every template.

Template: {label}: {date:Compact} {age} {value} {place}.<<br>Address: {address}.><<br>Notes: {note}><para>
Sentence: Sentence

Tip: To enter a tab character into a Sentence Template box use the Ctrl+Tab keys.

Tip: The Birth Event should add Name: {individual}<br> at the very start of the template.

Tip: Add other data between Address: and Notes: using the format <<br>Label: {code}.>
e.g.
<<br>Cause: {cause}.>
<<br>Witness: {role=witness}.>
<<br>Minister: {role=minister}.>

Census Event

This style caters for the 1939 National Register and relies on the full address being in the Place field.

Template: {individual} appeared in the {=TextIf(GetDisplayText(%FACT.DATE%,min) = "29 September 1939","National Register","Census")} {date} residing at {_place} {age}<br>
Sentence: He appeared in the Census on 31 March 1901 residing at 48, Springfield, Oxford, England aged 48.
Sentence: He appeared in the National Register on 29 September 1939 residing at 5, High Rd, Oxford, England.

Similarly for the Census (family) Event:

Template: {couple} appeared in the {=TextIf(GetDisplayText(%FACT.DATE%,min) = "29 September 1939","National Register","Census")} {date} residing at {_place} {their ages}<br>
Sentence: They appeared in the Census on 31 March 1901 residing at 48, Springfield, Oxford, England when he was 34 and she was 31.

Birth & Baptism Events

These are variants of the standard sentences to add the relationship to the File Root person.

The relationship is excluded if the person is the File Root, and also if a child of the File Root as those sentences already mention their son/daughter relationship by default.

Template: {individual} was born< {date}>< {place}>< ({age})>{=CombineText( Text( " and is " . FileRoot() . "'s "), TextIf(IsSameItem(FileRoot(),%CUR_PRIN%) or IsSameItem(FileRoot(),%CUR_PRIN.~FATH>%) or IsSameItem(FileRoot(),%CUR_PRIN.~MOTH>%), "", Relationship(FileRoot(),%CUR_PRIN%,TEXT,1) ) )}
Sentence: He was born on 1 May 1900 in London and is John Smith's grandfather.

This Baptism Event template adds the relationship when no Birth Event.

Template: {individual} was baptised< {date}>< {place}>< {age}>{=CombineText( Text( " and is " . FileRoot() . "'s "), TextIf(IsSameItem(FileRoot(),%CUR_PRIN%) or IsSameItem(FileRoot(),%CUR_PRIN.~FATH>%) or IsSameItem(FileRoot(),%CUR_PRIN.~MOTH>%) or Exists(%CUR_PRIN.BIRT%), "", Relationship(FileRoot(),%CUR_PRIN%,TEXT,1) ) )}.< The godparents were {role(plural)=godparent}.>< The godparent was {role(single)=godparent}.>< The ceremony was conducted by {role=minister}.>< The ceremony was conducted by {role=priest}.>}
Sentence: He was baptised on 3 June 1900 in London and is John Smith's grandfather.

Burial Event

This is a variant style of sentence to add interest.

Template: Following {his/her} death, {individual} was buried {date} {place} {age}<br>
Sentence: Following his death, he was buried on 23 March 1900 in Bristol, England aged 96.

Tip: Note that {date} {place} {age} does not need to use < {date}>< {place}>< {age}> because adjacent or trailing spaces resulting from empty fields are automatically pruned.