Page 1 of 1

Syntax for 'Place Formats', 'Short' field?

Posted: 05 Apr 2023 23:37
by Gary_G
What is the syntax needed to use the "Place Formats", "Short" field, to get the first part of the place-name contained in a template meta-field called {Commune}? I believe one uses the TEXTPART function.

I've tried it various ways, but FH7 complains that the syntax is incorrect.

Re: Syntax for 'Place Formats', 'Short' field?

Posted: 06 Apr 2023 10:04
by tatewise
Try:
{=TextPart( %SOUR.~PL-COMMUNE%, 1 )}

That combines the syntax for a function {=Function( ... )} with a metafield data ref shortcut %SOUR.~PL-COMMUNE% as described in the Help for Source Template Formats under How to Use Data References or Functions within Formats and the Help for Understanding Data References under Data References And Metafields as discussed before.

Re: Syntax for 'Place Formats', 'Short' field?

Posted: 06 Apr 2023 10:45
by Gary_G
Thanks, "tatewise";

It's obvious that I'm still having trouble wrapping my head around forming some of the function calls.
I'll reread the material yet again and look for some further examples.

Re: Syntax for 'Place Formats', 'Short' field?

Posted: 06 Apr 2023 15:55
by Gary_G
"tatewise";

I thought I'd mention in this thread that I looked at, Understanding Data References, https://www.family-historian.co.uk/help ... ences.html

It was helpful, But I note that the section, DATA REFERENCES AND METAFIELDS, has a table of 3-letter type prefixes to use for metafield types in data reference shortcuts, but does not contain one for address-type fields. Do they require a different technique to look up?

Re: Syntax for 'Place Formats', 'Short' field?

Posted: 06 Apr 2023 16:07
by ColeValleyGirl
Gary_G wrote:
06 Apr 2023 15:55
"tatewise";

I thought I'd mention in this thread that I looked at, Understanding Data References, https://www.family-historian.co.uk/help ... ences.html

It was helpful, But I note that the section, DATA REFERENCES AND METAFIELDS, has a table of 3-letter type prefixes to use for metafield types in data reference shortcuts, but does not contain one for address-type fields. Do they require a different technique to look up?
IIRC, they're usually text (TX-) fields, as there's no underlying record as there is in e.g. PLace

Re: Syntax for 'Place Formats', 'Short' field?

Posted: 06 Apr 2023 16:16
by Gary_G
"ColeValleyGirl";

Thank you.
So they are "Text" fields? Good to know. I'll try it.
The FH7 template definition had me totally confused, as it shows the type as "Address". (see below)
Address example.png
Address example.png (36.61 KiB) Viewed 400 times

Re: Syntax for 'Place Formats', 'Short' field?

Posted: 06 Apr 2023 16:35
by Gary_G
Unfortunately; Im still having issues in getting the address from the citation portion of a template and printing it as part of a citation. I know that I have some work to do to "tighten up the following Footnote template code, but I need to figure this out before that.
{Year} census of {=TextPart( %SOUR.~PL-COMMUNE%, 1, 0, TIDY_REV)}, <p. {Page}>, <{=TextPart(%CUR~CITN.~TX-STREET%, 1)}>, <house {House}>, <family {Family}>, <{Principal:SURNAME} <({Principal:GIVEN})>>, <{Age} years>, <{Role}>; image(s) {Image_no} from France, <{Repository}>, <<i>{Webpage_Title}</i>> <({Webpage_URL} : accessed {Accession_Date})>; <citing< {=TextPart( %SOUR.~PL-COMMUNE%, 1 )}>, <copie {Copy_Type}>, <cote [microfilm] {Cote_microfilm}>, <cote [original] {Cote_original}>>, <{Repository}>, <{Repository:LOCATION}>.

Re: Syntax for 'Place Formats', 'Short' field?

Posted: 06 Apr 2023 16:45
by ColeValleyGirl
My bad! They're "AD-" fields.

Re: Syntax for 'Place Formats', 'Short' field?

Posted: 06 Apr 2023 16:48
by Gary_G
Aha! So they are not in the documentation noted.
Thank you. I was pulling my hair out wondering what was happening.
Sorry to ask so many questions, but I am still finding my way...

Re: Syntax for 'Place Formats', 'Short' field?

Posted: 06 Apr 2023 16:52
by Gary_G
It lives!!!
Thank you "ColeValeyGirl".
Screenshot 2023-04-06 at 10.50.34 AM.png
Screenshot 2023-04-06 at 10.50.34 AM.png (30.86 KiB) Viewed 381 times

Re: Syntax for 'Place Formats', 'Short' field?

Posted: 06 Apr 2023 17:09
by tatewise
The AD code is in the FH built-in Help for Understanding Data References but missing from the online equivalent Help page.
Perhaps you would like to report that omission to CP?

Re: Syntax for 'Place Formats', 'Short' field?

Posted: 06 Apr 2023 18:06
by Gary_G
"tatewise";

Done.