Using Sentence Templates

From RootsMagic Wiki
Jump to navigation Jump to search

Navigation: RootsMagic 8 > Working With Facts > Fact Sentences >

Sentence Templates are the heart of narrative reports in RootsMagic. Sentence templates allow you to tell RootsMagic how to write a sentence when a particular role for a fact type is encountered in narrative reports or websites. (The template language is described in depth in the help topic, Sentence Template Language.)

Basic concepts

You simply write a sentence inserting "fields" to show where things like names, dates, and places fit, to compose sentences.

For example, if you wanted the sentence for the child (the principal person) in a birth fact to read:

John Smith was born on 5 January 1900 at 22 Any Street in Avon, Polk County, Iowa.

Then you would write a sentence template like:

[person] was born [date] [placedetails] [place].

When RootsMagic encounters the person’s birth fact when writing a narrative report, it takes this template and replaces [person] with the person’s name, [date] with the date of the birth, [placedetails] with the specific location (facility, address, etc.) of birth, and [place] with the place of birth.

Notice that when RootsMagic replaces [date] with the date, it adds the word "on" or "in" as appropriate, so you don’t need to take that into account in your template. Also, when RootsMagic replaces [placedetails] with the place details and [place] with the place, it automatically adds an "at" prefix before place details and "in" before the place so that you don’t have to include these words to the sentence template.

However, if there was no data entered into the [date], [place], or [placedetails] fields, the resulting sentence would read

John Smith was born .

This is because there are spaces between the fields. To avoid these extra spaces, "conditional angle brackets" are inserted around each field including the space before it, as:

[person] was born< [date]>< [placedetails]>< [place]>.

If a field is empty, the condition looking for data in the field would be false and anything within the angle brackets would not be shown. This ensures that the sentence will still read properly even if any of the date or place or place details fields are blank for a particular usage of the fact.

To avoid a sentence like

Lt. Col. John Harold "Harry" Doe, MD was born in 1827 in Barnet, Caledonia County, Vermont.

where a rank or other prefix and/or suffix earned later in life is shown for a newborn, you can control the portions of the name that are used, as in

[person:Given:Surname] was born< [date]>< [placedetails]>< [place]>.

The :Given:Surname suffixes on the field name are called field options, and tell RootsMagic to only insert the Given names and the Surname for this instance of the field name, thus the sentence would read

John Harold Doe was born in 1827 in Barnet, Caledonia County, Vermont.

Alternately, you could change the template to read

[person] was born [person:Given:Surname]< [date]>< [placedetails]>< [place]>.

which would read

Lt. Col. John Harold "Harry" Doe, MD was born John Harold Doe in 1827 in Barnet, Caledonia County, Vermont.

This introduces the person by their full name at maturity, yet indicates that their birth name was not as elaborate.

Other variations of the basic name include: [person:nickname:surname] and [person:casual].

The first, [person:nickname:surname], inserted into our basic sentence above, would result in:

Harry Doe was born in 1827 in Barnet, Caledonia County, Vermont.

The second variation, [person:casual], would show the nickname if one was entered, or the first name if there was no nickname entered.

Place and Date field options

The above examples dealt with name variations. However, [place], [placedetails] and [date] fields can also have variations. Let's look at the following template

[person:Given:Surname:Suffix] graduated< in [Date:Year]>< from [PlaceDetails:Plain]>< in [Place:Short]>.

With the appropriate values entered into the fields (for our John Doe above), this sentence could read:

John Harold Doe MD graduated in 1865 from Harvard Medical School in Boston, Mass.

You'll notice that each of the three fields, [place], [placedetails] and [date], has been modified. Let's look at the changes.

The < [date]> was initially modified so that only the year would be shown < [date:year]>. However, when the :year option was added, the preposition "in" or "on" was no longer automatically added, hence the addition of the "in" before the field.

The < [placedetails]> field was modified to < from [placedetails]> to initially change the preposition to "from" for better readability. However, this created the phrase "from at Harvard Medical School". The :plain field option, tells RootsMagic to not insert a preposition, so the sentence reads correctly. (The :plain field option works the same way with [date] and [place] fields.)

Finally the < [place]> field was modified to show the abbreviated form of the place name as entered into the Lists, Place list, Edit, Abbreviated place name field using the [place:short] field option. This option allows you to use the full place name as you originally entered it in the first instance, but use the shortened version in subsequent instances, but it will require you to customize each local fact or role sentence. Another option is [place:first] to use the first part of the place field, rather then the whole place field data.

To see the many other Fields, Field options, and conditional Switches available in RootsMagic, you are encouraged to read the help topic, Sentence Template Language.