Using templates

From GeneWeb
Revision as of 15:44, 25 July 2019 by Nspies (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
150px-Geographylogo svg.png Language:   English • français

The gwd server produces HTML code displayed by the client browser according to instructions stored in text files. Examples of such files are:

  • welcome.txt the welcome page shown when you connect to localhost:2317/basename.
  • perso.txt the page that displays one individual of the base.
  • updfam.txt the page containing the form to update a family.

A template is a set of such files organized into a coherent user interface. Template files are stored in folders named distribution/gw/etc/template_name and bases/etc/basename/template_name. Note that when searching for a template file, GeneWeb will search in the following order:

  • bases/etc/basename/file
  • bases/etc/template_name/file
  • distribution/gw/etc/template_name/file
  • distribution/gw/etc/file ?

If no file is found, then the search continues with the list of templates defined by the configuration variable template found in base.gwf.

As a result, you may limit your editing to the file whose content you want to change. All the other files will be found in the default folder according to the sequence above.

Templates are invoked by adding (through a clickable button if available, or manually if not) templ=templ_name; in the URL at the top of your browser. GeneWeb will "remember" this request for a template use and will automatically add the appropriate text in all subsequent URL requests.

See the experts section for further discussion on template programming.

Personnalisation Modules

La version 7 de GeneWeb offre nouvelle manière pour personnaliser l'aspect de la page personnelle. Cette solution repose sur l'existence d'une liste de modules définis dans le fichier de configuration base.gwf en associant chaque module à une lettre entre a et z (attention à ne pas mettre de texte supplémentaire après le nom de l'option - ni espaces, ni commentaires!).


Each module can be displayed with a choice of options.

The display of modules on a personnal pages will be governed by a vector defining a selection amongst the modules above, the order in which they are displayed and the chosen option.

The vector appears as a string of letters and digits. Each pair "letter, digit" identifies the selected module, and the value of its display options The modules are displayed in the order in which they appear in the p_mod parameter as in the example below, "gd_parents", "individual", "parents", "unions", ...

Pull-down menu for module and option selection.

Selecting p_mod=p1p2p3p4p5 will display all five options for the module parents.

The menubar of the perso.txt page provides an interface to change the value of this p_mod parameter and to select options. As the mouse hovers on the option button, a pop-up showing the general aspect of the chosen option will appear. On the rignt of the selection window, thise pop-ups will accumulate representing the resulting page..

You may choose any set of (single) letters (a-z) to designate modules.

The default configuration file a.gwf provides the list of available modules. Users have the possibility to add their own modules to be stored in the folder:


Note that the value of p_mod can be stored in the base.gwf parameter file. GeneWeb copies this value automatically in each URL in a fashion similar to the templ= variable. It may therefore be stored in a shortcut memorised by your browser. This is particularly usefull in the case of multi-user GeneWeb servers as GeneWeb cannot remember a user specific profile.

A graphical user interface facilitates the module and option selection. Thumbnails provide a graphical hint of the visual aspect of each option, and the right colums of the menu displays a mock-up of the resulting page. Personnal modules added by the user do not show up in this interface, but may be added through some editing of the gw/etc/p_mod.js file (use existing modules fas examples).

Several modules have their own visual adjustment buttons (number of generations, with or without images, with or without half brothers ans sisters, ...).


The file perso.txt controls the display of information associated with each person. Two modes of operation are provided through the following structure:

Import of utilities functions and menu bar.


Two display modes:

1/ two columns, fixed set of modules

  %( two columns if screen_width>=992px but full width for tablets/phone < 992px %)
    %if;(has_parents and (father.has_parents or mother.has_parents))
       <div class="collapse" id="collapseExample1">
    <div class="row">
      %(be carefull h1 is full width then an opening <div class="col-8"> in individu module %)
      </div> %( closing the <div class="col-8"> in module individu %)
      <div class="d-none d-lg-block col-lg-4">%(second column above lg%)

2/ One column. Modules modules labeled from a to z as defined in base.gwf and governed by the p_mod variable.

  %(Dynamic %)
      %if;(mmi!="" and ooi!=0)
        %apply;get_mod(mmi, ooi)


Examples of module definitions:



The result corresponding to each choice is as follows:

(These examples ware taken from a version 6 instance. Version 7 of GeneWeb may provide somewhat different results).

File name Example
Personal data.
Parents (simple).
Parents (more complex).
Parents (full).
Parents (with photo).
Union (simple).
Union (more complex).
Union (full).
Union (with photo).
Brothers and sisters (simple).
Brothers and sisters (full).
Tree, vertical, 3 generations.
Tree, vertical, 3 generations with photos.
Tree, vertical, 4 generations.
Tree, horizontal, 5 generations.

GeneWeb Manual

Rembrandt Old Man Reading a Book.jpg

Use and manage genealogical databases

Technical annex