Hi,
I'm having my first serious attempt at customising the text in diagrams...and have been scratching my head for the past couple of hours.
The following is supposed to:
1) Output "Born: " if there is any birth data - either date or place
2) Output the birth date
3) Output ", " IF there is a birth date AND and birth place, otherwise output ""
4) Output birth place
5) Output "."
=ExistsText(%INDI.BIRT%,"Born: ")%INDI.BIRT.DATE:COMPACT%=TextIf(Exists(%INDI.BIRT.DATE%) and Exists(%INDI.BIRT.PLAC%),", ")%INDI.BIRT.PLAC:SHORT%.
It sort of works but, if there is no date it is determined to put a ", " before the place.
In addition, I also want "." to appear after the date if there is no place recorded...
I'm also wanting this for baptism, marriage, death and burial - but this one example should suffice.
Thanks for taking the time,
Kind regards,
William
* Text Schemes in Diagrams
Text Schemes in Diagrams
William
- tatewise
- Megastar
- Posts: 28434
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Text Schemes in Diagrams
Text Templates are cleverer than you realise.
To force the comma ", " and full-stop "." in the correct conditions needs:
Born: %INDI.BIRT.DATE:COMPACT%=ExistsText(%INDI.BIRT.DATE%,ExistsText(%INDI.BIRT.PLAC%,", "))%INDI.BIRT.PLAC:SHORT%=ExistsText(%INDI.BIRT%,".")
The first ExistsText nested pair will output ", " only if both DATE & PLAC exist.
The last ExistsText will ouput "." if the Birth Event exists.
To force the comma ", " and full-stop "." in the correct conditions needs:
Born: %INDI.BIRT.DATE:COMPACT%=ExistsText(%INDI.BIRT.DATE%,ExistsText(%INDI.BIRT.PLAC%,", "))%INDI.BIRT.PLAC:SHORT%=ExistsText(%INDI.BIRT%,".")
The first ExistsText nested pair will output ", " only if both DATE & PLAC exist.
The last ExistsText will ouput "." if the Birth Event exists.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- Jane
- Site Admin
- Posts: 8518
- Joined: 01 Nov 2002 15:00
- Family Historian: V7
- Location: Somerset, England
- Contact:
Re: Text Schemes in Diagrams
Code: Select all
=ExistsText(%INDI.BIRT%,"Born: ")%INDI.BIRT.DATE:COMPACT%=TextIf(IsSet(%INDI.BIRT.DATE%) and IsSet(%INDI.BIRT.PLAC%),", ","")%INDI.BIRT.PLAC:SHORT%=TextIf(Exists(%INDI.BIRT%),".","")
In text schemes leading and trailing text is conditioned on the previous expression, so a simple . will be dropped when there is no place.
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."
- Jane
- Site Admin
- Posts: 8518
- Joined: 01 Nov 2002 15:00
- Family Historian: V7
- Location: Somerset, England
- Contact:
Re: Text Schemes in Diagrams
I think Mike and I worked on this at the same time, just goes to prove there is always at least two ways to do everything in FH.
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."
Re: Text Schemes in Diagrams
Thanks to you both - there are indeed more than one ways of skinning the proverbial cat.
Now to try to get the other events functioning in the same way
Thanks again,
William
Now to try to get the other events functioning in the same way
Thanks again,
William
William
Re: Text Schemes in Diagrams
I've used Jane's version and it's worked very nicely for Death and Burial. I've even managed to adapt it for Marriage.
However, for some reason I'm getting an error with the equivalent statement for Baptism. I'm using this:
=ExistsText(%INDI.BAPT%,"Baptised: ")%INDI.BAPT.DATE:COMPACT%=TextIf(IsSet(%INDI.BAPT.DATE%) and IsSet(%INDI.BAPT.PLAC%),", ","")%INDI.BAPT.PLAC:SHORT%=TextIf(Exists(%INDI.BAPT%),".","")
I don't understand why this fails when the others work - what am I missing??
However, for some reason I'm getting an error with the equivalent statement for Baptism. I'm using this:
=ExistsText(%INDI.BAPT%,"Baptised: ")%INDI.BAPT.DATE:COMPACT%=TextIf(IsSet(%INDI.BAPT.DATE%) and IsSet(%INDI.BAPT.PLAC%),", ","")%INDI.BAPT.PLAC:SHORT%=TextIf(Exists(%INDI.BAPT%),".","")
I don't understand why this fails when the others work - what am I missing??
William
- tatewise
- Megastar
- Posts: 28434
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Text Schemes in Diagrams
That is because the Baptism tag is BAPM not BAPT.
You should use the <<Insert > Data Reference Assistant to get the basic data ref and then adapt the Template.
You should use the <<Insert > Data Reference Assistant to get the basic data ref and then adapt the Template.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Re: Text Schemes in Diagrams
It's so simple when you know how...I've a lot to learn - thanks for your help tonight!
William