Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
how_to:narrative_report_fact_sentence_templates [2020/01/16 13:43]
tatewise [Standard Template Codes]
how_to:narrative_report_fact_sentence_templates [2020/05/22 20:24] (current)
tatewise [Introduction]
Line 2: Line 2:
  
 {{entry>​Customisation/​Fact Types;See Index for related topics}} {{entry>​Customisation/​Fact Types;See Index for related topics}}
 +{{entry>​Customisation/​Fact Witnesses;​-*}}
 +{{entry>​Customisation/​Sentence Templates;​-*}}
 +{{entry>​Customisation/​Witness Roles;-*}}
 {{entry>​Fact Types/​Customisation;​-*}} {{entry>​Fact Types/​Customisation;​-*}}
 +{{entry>​Fact Witnesses/​Customisation;​-*}}
 +{{entry>​Narrative Report/​Sentence Templates;​-*}}
 +{{entry>​Report Window/​Narrative Report/​Sentence Templates;​-*}}
 +{{entry>​Sentence Templates/​Customisation;​-*}}
 +{{entry>​Witness Roles/​Customisation;​-*}}
  
 ===== Introduction ===== ===== Introduction =====
Line 12: Line 20:
 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 [[Glossary:​Work with Fact Sets]] under **Custom Facts from other Products**. 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 [[Glossary:​Work with Fact Sets]] under **Custom Facts from other Products**.
  
-[[Glossary:​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.+[[Glossary:​Family Historian]] ({{fh}}) **V6** added a special custom **Fact Set** primarily for **FTM** migrants, but it can be used by anyone. Select the [[Glossary:​Work with Fact Sets#Custom Facts from other Products|Extended Set]] from the **Fact Set** drop list, and tick **Show Hidden** ​to reveal its details.
  
 ===== Finding Sentence Templates ===== ===== Finding Sentence Templates =====
Line 36: Line 44:
 {{ narrative_report_sentence_defaults.png?​700 |Default Sentence Templates}} {{ narrative_report_sentence_defaults.png?​700 |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.+**Tip:​** ​Such fact definition scenarios could include creating a fact list style or a foreign language style as alternatives to the default style. ​If you intend to extensively modify the default **Sentence Template** definitions for many **Facts**, it is advisable to use the **Fact Sets** button and **Clone** the chosen ​fact set, especially the **Standard** set. That allows ​any alternative definition styles to be easily swapped via the **Fact Set** priority order. ​Only the highest priority **Fact Set** will list its definitions,​ and its clones will appear to have **No Events ​or Attributes** unless **Show Hidden** is ticked to reveal their **<​eclipsed>​ <​disabled>​** definitions.
  
 ==== Specific Fact Sentences ==== ==== Specific Fact Sentences ====
Line 60: Line 68:
 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. 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.+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.+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 ==== ==== Data References & Functions ====
  
-Since {{fh}} **V6** both [[Understanding Data References|Data References]] and [[Understanding Functions|Functions]] can be inserted into **Sentence Templates** within curly brackets such as **{%FACT.PLAC>​LATLONG%}** or **{=TextPart(%FACT.PLAC%,​1,​2,​TIDY)}**.+Since {{fh}} **V6** both [[Understanding Data References|Data References]] and [[Understanding Functions|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 [[Understanding Data References|Contextual Data References]] that provide links to the **Individuals** and **Witnesses** associated with a **Fact**. Use the **%%<<​%%Insert Code > Data Reference** option to open the **Data Reference Assistant** dialogue that helps compose the **Codes**. There are special [[Understanding Data References|Contextual Data References]] that provide links to the **Individuals** and **Witnesses** associated with a **Fact**.
Line 72: Line 80:
 [[Understanding Functions|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. [[Understanding Functions|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 [[Understanding Functions|Functions]] so **{=TextIf(Exists({date}),​{date},"​ at unknown date"​)}** is not possible as explained in **Wish List** [[http://​www.fhug.org.uk/​wishlist/​wldisplay.php?​wlwlref=546|Ref 546 Enhanced use of Narrative Template Codes]]. However, it may be possible to substitute a [[Understanding Data References|Data Reference]] such as **%FACT.NOTE2%** instead of **{note}**.+Unfortunately,​ [[#Standard Template Codes]] are NOT recognised within [[Understanding Functions|Functions]] so ''​{=TextIf(Exists({date}),​{date},"​ at unknown date"​)}'' ​is not possible as explained in **Wish List** [[http://​www.fhug.org.uk/​wishlist/​wldisplay.php?​wlwlref=546|Ref 546 Enhanced use of Narrative Template Codes]]. However, it may be possible to substitute a [[Understanding Data References|Data Reference]] such as ''​%FACT.NOTE2%'' ​instead of ''​{note}''​.
  
 ==== Custom Fact Fields ==== ==== Custom Fact Fields ====
Line 78: Line 86:
 Custom fields cannot be added to Facts, and even if they could, when exported in [[Glossary:​Gedcom]] they would NOT be recognised by other genealogy products. Custom fields cannot be added to Facts, and even if they could, when exported in [[Glossary:​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**.+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**: Otherwise, the best solution uses labelled meta-fields in the **Note** field, such as for a **Baptism Event**:
 {{  narrative_report_sentence_text_note.png?​500 |Baptism Fact Note Labelled Text}} {{  narrative_report_sentence_text_note.png?​500 |Baptism Fact Note Labelled Text}}
 Where the following **Function Codes** would compose the necessary **Sentence** text:\\ Where the following **Function Codes** would compose the necessary **Sentence** text:\\
-**<by the {=GetLabelledText(%FACT.NOTE2%,"​Minister:​ ")} >**\\ +''​<by the {=GetLabelledText(%FACT.NOTE2%,"​Minister:​ ")} >''​\\ 
-**<for a fee of {=GetLabelledText(%FACT.NOTE2%,"​Charge:​ ")} >**\\+''​<for a fee of {=GetLabelledText(%FACT.NOTE2%,"​Charge:​ ")} >''​\\
  
 Each labelled meta-field can be included or excluded in any combination desired. Each labelled meta-field can be included or excluded in any combination desired.
  
-This not only allows the details to be exported satisfactorily in [[Glossary:​Gedcom]],​ but also allows other **Note** text not required in the **Sentence**,​ unlike the **{note}** code that would include it all.+This not only allows the details to be exported satisfactorily in [[Glossary:​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.+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. 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.+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 ===== ===== 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.+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 ==== ==== Tabulated Facts ====
  
-This mimics the [[Glossary:​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. +This mimics the [[Glossary:​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://​\\ 
-//​Template:// ​**{label}: {date:​Compact} {age} {value} {place}.%%<<​br>​%%Address:​ {address}.>​%%<<​br>​%%Notes:​ {note}><​para>​**\\ +''​{label}: {date:​Compact} {age} {value} {place}.%%<<​br>​%%Address:​ {address}.>​%%<<​br>​%%Notes:​ {note}><​para>​''​\\ 
-//​Sentence://​ {{liststylesentence.png?​350|Sentence}}+//​Sentence://​\\ 
 +{{liststylesentence.png?​350|Sentence}}
  
 //Tip:// To enter a tab character into a **Sentence Template** box use the **Ctrl+Tab** keys. //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:// 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}.>**\\+//Tip:// Add other data between ​''​Address:'' ​and ''​Notes:'' ​using the format ​''​%%<<​br>​%%Label:​ {code}.>''​\\
 e.g.\\ e.g.\\
-**%%<<​br>​%%Cause:​ {cause}.>​**\\ +''​%%<<​br>​%%Cause:​ {cause}.>​''​\\ 
-**%%<<​br>​%%Witness:​ {role=witness}.>​**\\ +''​%%<<​br>​%%Witness:​ {role=witness}.>​''​\\ 
-**%%<<​br>​%%Minister:​ {role=minister}.>​**\\+''​%%<<​br>​%%Minister:​ {role=minister}.>​''​\\
  
 ==== Census Event ==== ==== Census Event ====
Line 121: Line 130:
 This style caters for the **1939 National Register** and relies on the full address being in the **Place** field. 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>​**\\ +//​Template://​\\ 
-//​Sentence:// ​**He appeared in the Census on 31 March 1901 residing at 48, Springfield, Oxford, England aged 48.**\\ +''​{individual} appeared in the\\ 
-//​Sentence:// ​**He appeared in the National Register on 29 September 1939 residing at 5, High Rd, Oxford, England.**+ {=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 8 Main St, 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**: 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>​**\\ +//​Template://​\\ 
-//​Sentence:// ​**They appeared in the Census on 31 March 1901 residing at 48, Springfield, Oxford, England when he was 34 and she was 31.**+''​{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 8 Main St, Oxford, England when he was 34 and she was 31.''​
  
 ==== Birth & Baptism Events ==== ==== Birth & Baptism Events ====
Line 136: Line 154:
 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. 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) ) )}**\\ +//​Template://​\\ 
-//​Sentence:// ​**He was born on 1 May 1900 in London and is John Smith'​s grandfather.**+''​{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**. 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}.>​}**\\ +//​Template://​\\ 
-//​Sentence:// ​**He was baptised on 3 June 1900 in London and is John Smith'​s grandfather.**+''​{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 ==== ==== Burial Event ====
Line 148: Line 176:
 This is a variant style of sentence to add interest. This is a variant style of sentence to add interest.
  
-//​Template:// ​**Following {his/her} death, {individual} was buried {date} {place} {age}<​br>​**\\ +//​Template://​\\ 
-//​Sentence:// ​**Following his death, he was buried on 23 March 1900 in Bristol, England aged 96.**+''​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.+//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.
  
 ===== Related Pages ===== ===== Related Pages =====