Page 1 of 1

Template codes

Posted: 15 Jan 2020 10:29
by ColinMc
I haven't done a lot with Template Codes, so I may be missing something obvious.

I'm trying to edit the Burial Sentence text, to show the Address if it exists

Code: Select all

<in {address},> {_place}
works fine for me if both Place and Address exist (it is not perfect if I do not have Place as the comma is then superfluous, but if I know an Address, I will be able to include a Place as well).

Is there a way to ensure that {_place} is replaced by {place} if Address is not present? I suspect its is possible using the functions which the help file warns me against using unless Advanced. I'm nowhere near there yet, so would appreciate some help.

I will probably then edit some other texts with the same change. Thanks

Re: Template codes

Posted: 15 Jan 2020 10:52
by tatewise
Often the word in before Address does not read very well but at almost always seems OK.
When at is used, it allows in to appear between Address and Place.
e.g.
He died in 1900 in 23, Park Road, Newtown, Kent. does not scan well
He died in 1900 at 23, Park Road in Newtown, Kent. reads OK
He was buried in 1900 at Park Road Cemetery in Newtown, Kent. also reads OK

So the Template for that is < at {address}> {place} which works for any combination of Address and Place field.
i.e.
He was buried in 1900 at Park Road Cemetery in Newtown, Kent. both
He was buried in 1900 at Park Road Cemetery. only Address
He was buried in 1900 in Newtown, Kent. only Place
He was buried in 1900. neither

In the very rare cases where the above does not read well, then edit the Sentence Template just for that specific fact in the Facts tab of the Property Box.
See Knowledge Base > Narrative Report Fact Sentence Templates.

Trying to get the word in with either Address or Place present and the comma only when both are present involves quite an advanced complex expression using functions.

Re: Template codes

Posted: 15 Jan 2020 11:01
by ColinMc
Thanks, as usual, ridiculously fast response and a good answer too.

Much appreciated.