« Customize the way witnesses to events are mentioned | Contents | Creating a simple Ahnentafel »

Template roles

Before v.3.1.11 Genbox templates could only refer to witnesses by number; from 3.1.11 onwards, templates can refer to the witnesses by role. Take this birth event:

The default birth template will generate this in a report (click the magnifying glass next to the template for a preview):

Jan Philippe David Vuijlsteke was born on 18 February 2004 at AZ Sint-Lucas, Groenebriel 1, Gent. Witnesses: Alec Stanislas James Vuijlsteke, godfather; Katrien De Meyer, godmother; Henk Loobuyck, gynecologist; Maria Virginia Mertens, midwife; Inge Dhaene and Octavia Gilliet, nurses. Jan was 50 cm long and weighed 3630 g.

The "Witnesses: ..." sentence is generated through the General Template; as described in Customizing the way witnesses are mentioned we can override this in the local template.

You can refer to witness roles in templates with the code [W:rolename]:

[P] was born [D+L]. Godfather was [W:godfather]. Godmother was [W:godmother].

will generate

Jan Philippe David Vuijlsteke was born on 18 February 2004 at AZ Sint-Lucas, Groenebriel 1, Gent. Godfather was Alec Stanislas James Vuijlsteke. Godmother was Katrien De Meyer. Witnesses: Henk Loobuyck, gynecologist; Maria Virginia Mertens, midwife; Inge Dhaene and Octavia Gilliet, nurses. Jan was 50 cm long and weighed 3630 g.

Why? Remember that the General Template contains the code "Witnesses: [?WWR]", which will append the phrase "Witnesses: " and then the names and roles of all witnesses that haven't been mentioned by the local template. In this case the local template mentions the godfather and the godmother; the other witnesses and their roles have been generated through the Global Template.

It's not necessary to define all possible roles in all templates, but we can refine the birth template a bit further. Let's say that we make provisions for godparents and gynecologist, and that all the other witnesses with their respective roles will be mentioned as "Also present".

[P] was born [D+L]. [W:godfather] was [PP] godfather. [W:godmother] was [PP] godmother. [W+:gynecologist] was [PP] gynecologist. Also present: [WWR+]

gives this sentence:

Jan Philippe David Vuijlsteke was born on 18 February 2004 at AZ Sint-Lucas, Groenebriel 1, Gent. Alec Stanislas James Vuijlsteke was Jan's godfather. Katrien De Meyer was Jan's godmother. Henk Loobuyck was Jan's gynecologist. Also present: Maria Virginia Mertens, midwife; Inge Dhaene and Octavia Gilliet, nurses.1 Jan was 50 cm long and weighed 3630 g.

The repetition of three "X was Jan's Z" is less than elegant (not to mention that the gynecologist is actually his mother's gynecologist). We can change that:

[P] was born [D+L]. [W+:gynecologist] was [SP] gynecologist. [W:godfather] and [W:godmother] were [PP] godparents. Also present: [WWR+]

makes the more readable

Jan Philippe David Vuijlsteke was born on 18 February 2004 at AZ Sint-Lucas, Groenebriel 1, Gent. Henk Loobuyck was Sandra Pattyn's gynecologist. Alec Stanislas James Vuijlsteke and Katrien De Meyer were Jan's godparents. Also present: Maria Virginia Mertens, midwife; Inge Dhaene and Octavia Gilliet, nurses. Jan was 50 cm long and weighed 3630 g.

We could leave it at that, but there's always the possibility that not all the data is filled in for a given birth event. With the template as it stands, you could get things like this:

Michel Vuijlsteke was born on 27 August 1970 in Gent. was Marie Louise (Mia) Waegenaer's gynecologist. Arthur Oscar Marie Zélie Vuijlsteke and Germana Michaella (Germaine) Sierens were Michel's godparents. Also present.

or

Steven Arthur Alice Waegenaer was born on 5 April 1975 in Gent. was Frieda (Frie) Heirman's gynecologist. and Marie Louise (Mia) Waegenaer were Steven's godparents. Also present.

...not very nice. Use < > to indicate optional bits in the template. First the easy ones:

[P] was born [D+L]<. [W+:gynecologist] was [SP] gynecologist>. [W:godfather] and [W:godmother] were [PP] godparents<. Also present: [WWR+]>

If no gynecologist is defined, there won't be a peep about a gynecologist. And if there are no other witnesses except godparents and gynecologist, there will be no "Also present":

Steven Arthur Alice Waegenaer was born on 5 April 1975 in Gent. and Marie Louise (Mia) Waegenaer were Steven's godparents.

Now for the godparents. There are four cases possible:

  • no godfather and no godmother mentioned
  • both godfather and godmother mentioned
  • godfather mentioned but no godmother
  • godmother mentioned but no godfather

Here's how we handle this:

[P] was born [D+L]<. [W+:gynecologist] was [SP] [WR] ><. [W:godfather] and [W:godmother] were [PP] godparents|. [W:godfather] was [PP] [WR]|. [W:godmother] was [PP] [WR] ><. Also present: [WWR+]>

As a final check, run this template against a number of different birth tag with varying degrees of "completeness":

Jan Waegenaer was born on 24 December 1952 in Gent.

Steven Arthur Alice Waegenaer was born on 5 April 1975 in Gent. Marie Louise (Mia) Waegenaer was his godmother.

Michel Vuijlsteke was born on 27 August 1970 in Gent. Arthur Oscar Marie Zélie Vuijlsteke and Germana Michaella (Germaine) Sierens were his godparents.

Zelie Marie Anna Vuijlsteke was born on 28 June 1999 at AZ Sint-Lucas, Groenebriel 1, Gent. Henk Loobuyck was Sandra Pattyn's gynecologist. Philippe Didier Jan Vuijlsteke and Sofie Pattyn were Zelie's godparents. Zelie weighed 3535 g.

Jan Philippe David Vuijlsteke was born on 18 February 2004 at AZ Sint-Lucas, Groenebriel 1, Gent. Henk Loobuyck was Sandra Pattyn's gynecologist. Alec Stanislas James Vuijlsteke and Katrien De Meyer were Jan's godparents. Also present: Maria Virginia Mertens, midwife; Inge Dhaene and Octavia Gilliet, nurses. Jan was 50 cm long and weighed 3630 g.

Marcellus Gilliet was born on 12 December 1850 in Gent. Also present: Basilius Franciscus Gilliet and Bonaventure Pusters.

Ah. There's a problem when there are no godparents and no gynecologist, but only "others".

Is there a way to have the template say "Also present: " when there's either a godfather, a godmother or a gynecologist, but "Witnesses: " when there's only other witnesses? All suggestions are welcome!

Posted by Michel Vuijlsteke on July 11, 2004 at 08:17 PM in Templates | Permalink

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d834530fb269e200e5501fe5de8833

Listed below are links to weblogs that reference Template roles:

Comments

Hi Michel,

For your last question, try "[P] was born [D+L]<. [W:gynecologist] was [SP] [WR] ><. [W:godfather] and [W:godmother] were [PP] godparents|. [W:godfather] was [PP] [WR]|. [W:godmother] was [PP] [WR+]|. Witnesses: [WWR+]><. Also present: [WWR+]>

Gr. Wim

Posted by: Wim | Aug 10, 2004 8:13:16 AM

Only problem so far: when there are a gynecologist plus other witnesses but no godparent(s), it will also result in "Witnesses" instead of "Also present"

Posted by: Wim | Aug 10, 2004 8:26:57 AM

Sheila is one of those hot babes who looks like she’s too good to suck cock. In fact if you saw her in the street you would never think that you were looking at a nasty cocksucking bitch. But that’s just what she is and you should see her in action. http://oral-fucking.nichepass.com/?prog=2&aff=686&saff=2>free sex.

Posted by: GomyEmormum | Dec 18, 2007 8:54:19 PM

Hello Dear....Tell me, why you put our photos on this site? http://chicasensual20.tripod.com>Adult People Connection!!!
http://chicasensual20.tripod.com

Posted by: PamLFemaleQ | Jan 6, 2008 11:08:37 PM