* Sentence template age attribute vs fact age
- dewilkinson
- Superstar
- Posts: 286
- Joined: 04 Nov 2016 19:05
- Family Historian: V7
- Location: Oundle, Northamptonshire, England
- Contact:
Sentence template age attribute vs fact age
I have tried without success to locate how to include in a Fact sentence template use the age attribute if present else use the calculated age i.e. use {age} if not present use {%FACT.AGE%}. Is such an IF / OR possible in a sentence template?
David Wilkinson researching Bowtle, Butcher, Edwards, Gillingham, Overett, Ransome, Simpson, and Wilkinson in East Anglia
Deterioration is contagious, and places are destroyed or renovated by the spirit of the people who go to them
Deterioration is contagious, and places are destroyed or renovated by the spirit of the people who go to them
- Jane
- Site Admin
- Posts: 8518
- Joined: 01 Nov 2002 15:00
- Family Historian: V7
- Location: Somerset, England
- Contact:
Re: Sentence template age attribute vs fact age
You could try something like
Code: Select all
{=TextIf(Exists(%FACT.AGE%),%FACT.AGE%,AgeAt(%CUR_PRIN%,%FACT.DATE%))}
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
- LornaCraig
- Megastar
- Posts: 3202
- Joined: 11 Jan 2005 17:36
- Family Historian: V7
- Location: Oxfordshire, UK
Re: Sentence template age attribute vs fact age
FH has template codes to do this.
From the FH help files:
From the FH help files:
- Attachments
-
- age codes.JPG (80.49 KiB) Viewed 3543 times
Lorna
- tatewise
- Megastar
- Posts: 28435
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Sentence template age attribute vs fact age
Or:
{=CombineText( ,%FACT.AGE%, , AgeAt(%CUR_PRIN%,%FACT.DATE%) )}
but for Family facts (Marriage, Divorce, etc) it gets more complex and I have not worked it out yet.
{=CombineText( ,%FACT.AGE%, , AgeAt(%CUR_PRIN%,%FACT.DATE%) )}
but for Family facts (Marriage, Divorce, etc) it gets more complex and I have not worked it out yet.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- dewilkinson
- Superstar
- Posts: 286
- Joined: 04 Nov 2016 19:05
- Family Historian: V7
- Location: Oundle, Northamptonshire, England
- Contact:
Re: Sentence template age attribute vs fact age
Lorna, Mike,
Many thanks, both work but I have gone with the CombineText version. I primarily wanted this for death records as many ancient burial records didn't record an age.
My death sentence now reads
Many thanks, both work but I have gone with the CombineText version. I primarily wanted this for death records as many ancient burial records didn't record an age.
My death sentence now reads
Code: Select all
<para>{%CUR_PRIN.NAME[1]:FIRST%} died< of {cause}>< on {%FACT.DATE:DAY_OF_WEEK%}>< {date}>< at {_place}>< aged {=CombineText( ,%FACT.AGE%, , AgeAt(%CUR_PRIN%,%FACT.DATE%) )}><, {note}>. <This death was witnessed by {role=witness}. >
David Wilkinson researching Bowtle, Butcher, Edwards, Gillingham, Overett, Ransome, Simpson, and Wilkinson in East Anglia
Deterioration is contagious, and places are destroyed or renovated by the spirit of the people who go to them
Deterioration is contagious, and places are destroyed or renovated by the spirit of the people who go to them