Outline of a Template

This section gives an outline for all templates (see here for an example tempplate that illustrates concepts in this outline).

A template defines a series of cells for displaying data from a single GEDCOM Structure (see below), which may be a record or a single tag in a record. Many cells will display labels or pictures to define the graphical appearance of the window Other cells will provide ways to edit the genealogical data, such as by typing text, selecting from a pop-up menu, or clicking a check box.

Each template can have at most one editing cell. With this editing cell the user can edit the first line of data in the GEDCOM Structure being formatted for display by the template. If the structure has subordinate lines, those lines can only be edited by calling templates for the tags used in the structure from the main template.

The first line of a GEDCOM Record cannot be changed because it defines the type of record and a Record Pointer for that record. Thus, GEDCOM Record Editing templates cannot contain the one editing cell. (Note: This restriction does not hold for "(Pseudo_Tag) Record Editing" templates called using StructuresLink cells. These templates are for a subset of data of a main GEDCOM Record to be displayed in a Child Window. The templates for these Child Windows may have one editing cell for the first line of data in that subset.)

All GEDCOM Records and many GEDCOM Structures will have more than one line. These extra lines, known as subordinate data for the record or structure, will be in GEDCOM lines with line numbers greater than the first line. As explained above, the template for the main record or any structure cannot provide editing cells for this subordinate data. To allow the user to edit such data, the main templates must call other templates using Show and ShowAll commands. These "called" templates can provide the required editing cells. To make sure the GEDCOM data always gets edited in the correct order, all Show and ShowAll commands must come after the single editing cell in the original template. In other words, no editing cells can be used after there has been a Show and ShowAll command.

A basic outline for all templates is

  1. Some Labeling, Static, or Button Cells
  2. One Editing Cell
  3. More Labeling, Static, or Button Cells
  4. Some Show and ShowAll commands
  5. More Labeling, Static, or Button Cells
  6. More Show and ShowAll commands
  7. etc.

All parts in this outline are optional. For example, the template may have an editing cell, but might not have any labeling cells or any Show and ShowAll commands. Alternatively, a template may choose to have no editing cell. It may just display information for the user to see, but not edit. Furthermore, you do not need to have Show or ShowAll commands for all possible data and do not need to have them in any particular order. See the example template for for details on dealing with subordinate data that is not referenced in a template.