* Source Templates, Style Codes and Record Title formats
-
shoshk
- Famous
- Posts: 242
- Joined: 13 May 2015 16:28
- Family Historian: V7
- Location: Mitzpe Jericho, Israel
Source Templates, Style Codes and Record Title formats
It looks like Style Codes are not available in the Record Title format. Why?
My current titles include the person's name in the format SURNAME, Given. My husband wants to keep it that way but I don't see an easy way to do it with templated sources. I can program it, but would prefer not to.
Should I add it to the wish list?
My current titles include the person's name in the format SURNAME, Given. My husband wants to keep it that way but I don't see an easy way to do it with templated sources. I can program it, but would prefer not to.
Should I add it to the wish list?
Shosh Kalson
- Jane
- Site Admin
- Posts: 8440
- Joined: 01 Nov 2002 15:00
- Family Historian: V7
- Location: Somerset, England
- Contact:
Re: Source Templates, Style Codes and Record Title formats
The record title is not a Rich Text note field, it's a standard text field, which is populated by the template when the templated source is entered or changed, by default.
If you want to edit it manually untick the Auto Generated option next to the title field in the Citation Window.
If you want to edit it manually untick the Auto Generated option next to the title field in the Citation Window.
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."
- tatewise
- Megastar
- Posts: 27074
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Source Templates, Style Codes and Record Title formats
Sorry, but I don't understand the problem
The name format SURNAME, Given is nothing to do with Style Codes.
In the Source Templates I've looked at, that have a Name field, they simply repeat whatever is entered as the Name in the Title.
So if you enter the Name as SURNAME, Given then that is what you get in the Title.
The name format SURNAME, Given is nothing to do with Style Codes.
In the Source Templates I've looked at, that have a Name field, they simply repeat whatever is entered as the Name in the Title.
So if you enter the Name as SURNAME, Given then that is what you get in the Title.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
-
shoshk
- Famous
- Posts: 242
- Joined: 13 May 2015 16:28
- Family Historian: V7
- Location: Mitzpe Jericho, Israel
Re: Source Templates, Style Codes and Record Title formats
I need 2 versions of the name. In addition to using SURNAME, Given in the title, I use Given Surname in the formatted footnote.
I guess I'll take care of this programmatically. It's not difficult because our sources are all created via plugin (currently being rewritten to take advantage of new features in FH7). I simply prefer to let FH do the heavy lifting whenever possible.
I guess I'll take care of this programmatically. It's not difficult because our sources are all created via plugin (currently being rewritten to take advantage of new features in FH7). I simply prefer to let FH do the heavy lifting whenever possible.
Shosh Kalson
- tatewise
- Megastar
- Posts: 27074
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Source Templates, Style Codes and Record Title formats
OK, that is possible.
Enter the Name using the SURNAME, Given format and construct the Footnote Template to extract the two name parts, reverse them and adjust the SURNAME to Surname:
{=Section(%SOUR.~TX-NAME%,2,",")} extracts the 2nd Section of Given name(s) after the comma.
{=Text(LeftText(Section(%SOUR.~TX-NAME%,1,","),1).ToLower(MidText(Section(%SOUR.~TX-NAME%,1,","),2)))}
This extracts the 1st Section before comma, leaves left-hand character in capitals and makes the remainder lower case.
The Text concatenation is needed because otherwise a space gets inserted between the functions.
Enter the Name using the SURNAME, Given format and construct the Footnote Template to extract the two name parts, reverse them and adjust the SURNAME to Surname:
{=Section(%SOUR.~TX-NAME%,2,",")} extracts the 2nd Section of Given name(s) after the comma.
{=Text(LeftText(Section(%SOUR.~TX-NAME%,1,","),1).ToLower(MidText(Section(%SOUR.~TX-NAME%,1,","),2)))}
This extracts the 1st Section before comma, leaves left-hand character in capitals and makes the remainder lower case.
The Text concatenation is needed because otherwise a space gets inserted between the functions.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
-
shoshk
- Famous
- Posts: 242
- Joined: 13 May 2015 16:28
- Family Historian: V7
- Location: Mitzpe Jericho, Israel
Re: Source Templates, Style Codes and Record Title formats
Pretty much (if not all) the fields in the source template are filled in automatically by the plugin.
One of the features of my plugin is that is copies (can copy) much of its data from the source (using copy and paste) from the webpage. Often, the name is in the format Given Surname.
I think I'll just add two fields to the source template for the uppercase version of the surname -- TX-SURNAME_1 and TX-SURNAME_2. It's trivial to add a few lines to the plugin to fill in these fields.
I was just hoping that this business could be handled by FH, but I understand why style codes don't apply in the title format
One of the features of my plugin is that is copies (can copy) much of its data from the source (using copy and paste) from the webpage. Often, the name is in the format Given Surname.
I think I'll just add two fields to the source template for the uppercase version of the surname -- TX-SURNAME_1 and TX-SURNAME_2. It's trivial to add a few lines to the plugin to fill in these fields.
I was just hoping that this business could be handled by FH, but I understand why style codes don't apply in the title format
Shosh Kalson
- tatewise
- Megastar
- Posts: 27074
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Source Templates, Style Codes and Record Title formats
I'm not sure why you keep mentioning Style Codes.
They have nothing to do with manipulating plain text and changing case.
The code I posted are NOT Style Codes, which are to do with bold, italics, underline, and suchlike.
However, I could not devise codes to convert Given Surname to SURNAME, Given so you will have to use two fields.
They have nothing to do with manipulating plain text and changing case.
The code I posted are NOT Style Codes, which are to do with bold, italics, underline, and suchlike.
However, I could not devise codes to convert Given Surname to SURNAME, Given so you will have to use two fields.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
-
shoshk
- Famous
- Posts: 242
- Joined: 13 May 2015 16:28
- Family Historian: V7
- Location: Mitzpe Jericho, Israel
Re: Source Templates, Style Codes and Record Title formats
I know I can't use Style Codes in the Record format. I wish I could. That would allow me to format the surname as uppercase without writing more code.
Shosh Kalson
- tatewise
- Megastar
- Posts: 27074
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Source Templates, Style Codes and Record Title formats
Shosh, I will say it once again and then shut up.
Style Codes DO NOT CHANGE CASE or SWAP WORDS they ONLY affect font style like bold, italic, underscore.
The codes I posted earlier would work in the Record Title Template just as well as in the Footnote Template.
They are ONLY manipulating plain text and not font styles.
They just convert from SURNAME, Given to Given Surname and no Style Codes are involved.
I simply can't work out the codes need to convert from Given Surname to SURNAME, Given because there is no convenient delimiter (,).
The code that converts to uppercase is {=ToUpper(...)} and that is a Function code not a Style Code.
Style Codes DO NOT CHANGE CASE or SWAP WORDS they ONLY affect font style like bold, italic, underscore.
The codes I posted earlier would work in the Record Title Template just as well as in the Footnote Template.
They are ONLY manipulating plain text and not font styles.
They just convert from SURNAME, Given to Given Surname and no Style Codes are involved.
I simply can't work out the codes need to convert from Given Surname to SURNAME, Given because there is no convenient delimiter (,).
The code that converts to uppercase is {=ToUpper(...)} and that is a Function code not a Style Code.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
-
shoshk
- Famous
- Posts: 242
- Joined: 13 May 2015 16:28
- Family Historian: V7
- Location: Mitzpe Jericho, Israel
Re: Source Templates, Style Codes and Record Title formats
As always, morning wake-up gave me a simple solution which is taken from the idea proposed by you.
I had not considered using FH functions within the title format.
I won't be adding (and maintaining an extra field). The following expression gives me exactly what I need:
Thank you for your persistence which clearly triggered the little guy in my brain who keeps pondering while I sleep. 
I had not considered using FH functions within the title format.
I won't be adding (and maintaining an extra field). The following expression gives me exactly what I need:
Code: Select all
{=ToUpper(%SOUR.~NM-Name_Recorded_1:SURNAME%)}, {Name_Recorded_1:GIVEN}Shosh Kalson
- tatewise
- Megastar
- Posts: 27074
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Source Templates, Style Codes and Record Title formats
Yes, excellent. I had not realised you were using a Name (NM) meta-field rather than a Text (TX) meta-field.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry