Difference between revisions of "Template:Pagelang"

From GeneWeb
Jump to: navigation, search
(Examples)
Line 100: Line 100:
 
!File name!!Content!!Example
 
!File name!!Content!!Example
 
|-
 
|-
|etat_civil||Personal data||[[File:etatcivil.jpg|thumb|400px|center|Personal data.]]
+
|etat_civil|||[[File:etatcivil.jpg|thumb|400px|center|Personal data.]]
 
|-
 
|-
|parent_simple||Parents (simple)||[[File:parent_simple.jpg|thumb|400px|center|Parents (simple).]]
+
|parent_simple||[[File:parent_simple.jpg|thumb|400px|center|Parents (simple).]]
 
|-
 
|-
|parent_evolue|| Parents (more complex)||[[File:parent_evolue.jpg|thumb|400px|center|Parents (more complex).]]
+
|parent_evolue||[[File:parent_evolue.jpg|thumb|400px|center|Parents (more complex).]]
 
|-
 
|-
|parent_complet||Parents (full}||[[File:parent_complet.jpg|thumb|400px|center|Parents (full).]]
+
|parent_complet|[[File:parent_complet.jpg|thumb|400px|center|Parents (full).]]
 
|-
 
|-
|parent_photo||Parents (with photo)||<img src="http://opensource.geneanet.org/attachments/163/parent_photo.jpg" alt="" />
+
|parent_photo||[[File:parent_complet.jpg|thumb|400px|center|Parents (with photo).]]
 
|-
 
|-
|union_simple||Union (simple)||<img src="http://opensource.geneanet.org/attachments/154/union_simple.jpg" alt="" />
+
|union_simple||[[File:parent_complet.jpg|thumb|400px|center|Union (simple).]]
 
|-
 
|-
|union_evolue||Union (complex)||<img src="http://opensource.geneanet.org/attachments/155/union_evolue.jpg" alt="" />
+
|union_evolue||[[File:parent_complet.jpg|thumb|400px|center|Union (complex).]]
 
|-
 
|-
|union_complet||Union (full)||<img src="http://opensource.geneanet.org/attachments/156/union_complet.jpg" alt="" />
+
|union_complet|[[File:parent_complet.jpg|thumb|400px|center|Union (full)|.]]
 
|-
 
|-
|union_photo||Union (photo)||<img src="http://opensource.geneanet.org/attachments/157/union_photo.jpg" alt="" />
+
|union_photo||[[File:parent_complet.jpg|thumb|400px|center|Union (photo).]]
 
|-
 
|-
|frereoeur simple||Brothers and sisters (simple)||<img src="http://opensource.geneanet.org/attachments/162/freresoeur_simple.jpg" alt="" />
+
|frereoeur simple||Brothers and sisters (simple)||[[File:parent_complet.jpg|thumb|400px|center|Brothers and sisters (full).]]
 
|-
 
|-
|frereoeur_complet||Brothers and sisters (full)||<img src="http://opensource.geneanet.org/attachments/167/freresoeur_complet.jpg" alt="" />
+
|frereoeur_complet||[[File:parent_complet.jpg|thumb|400px|center|Parents (full).]]
 
|-
 
|-
|famille ||Family||<img src="http://opensource.geneanet.org/attachments/168/famille.jpg" alt="" />
+
|famille ||[[File:parent_complet.jpg|thumb|400px|center|Family.]]
 
|-
 
|-
|relations||Relations||<img src="http://opensource.geneanet.org/attachments/169/relations.jpg" alt="" />
+
|relations||[[File:parent_complet.jpg|thumb|400px|center|Relations.]]
 
|-
 
|-
|notes||Notes||<img src="http://opensource.geneanet.org/attachments/170/notes.jpg" alt="" />
+
|notes||[[File:parent_complet.jpg|thumb|400px|center|Notes.]]
 
|-
 
|-
|sources||Sources||<img src="http://opensource.geneanet.org/attachments/171/sources.jpg" alt="" />
+
|sources||[[File:parent_complet.jpg|thumb|400px|center|Sources.]]
 
|-
 
|-
|timeline||Timeline||<img src="http://opensource.geneanet.org/attachments/171/sources.jpg" alt="" />
+
|timeline||[[File:parent_complet.jpg|thumb|400px|center|Timeline.]]
 
|-
 
|-
|arbre_3gen_v||Tree, vertical, 3 gen||<img src="http://opensource.geneanet.org/attachments/164/arbre_nav3.jpg" alt="" />
+
|arbre_3gen_v||[[File:parent_complet.jpg|thumb|400px|center|Tree, vertical, 3 gen.]]
 
|-
 
|-
|arbre_3gen_v_photo||Tree, vertical, 3 gen, photos||<img src="http://opensource.geneanet.org/attachments/165/arbre_nav3photos.jpg" alt="" />
+
|arbre_3gen_v_photo||[[File:parent_complet.jpg|thumb|400px|center|Tree, vertical, 3 gen, photos.]]
 
|-
 
|-
|arbre_4gen_v||Tree, vertical, 4 gen||<img src="http://opensource.geneanet.org/attachments/172/arbre_nav4.jpg" alt="" />
+
|arbre_4gen_v||[[File:parent_complet.jpg|thumb|400px|center|Tree, vertical, 4 gen.]]
 
|-
 
|-
|arbre_5gen_h||Tree, horizontal, 5 gen||<img src="http://opensource.geneanet.org/attachments/166/arbre_nav5h.jpg" alt="" />
+
|arbre_5gen_h||[[File:parent_complet.jpg|thumb|400px|center|Tree, horizontal, 5 gen.]]
 
|}
 
|}

Revision as of 18:52, 16 October 2015



Templates are a set of text files used by the gwd server to produce the HTML code displayed by the client browser. 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

Templates are invoqued 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.

Template files are stored in folders named geneweb/gw/etc/template_name.

When executing its tasks, gwd will search for the needed files in several folders in the following sequence:

bdir/etc/base/
gw/etc/template_name/
gw/etc/

where -bdir is the value of the -bd parameter of gwd, and gw is the folder in which sits gwd.

(this needs to be verified. Are bdir/etc/base/template and gw/etc/base looked into? Behaviour changed between 6.08 and 7.00 Henri83 (talk) 18:02, 16 October 2015 (CEST)).

Perso.txt

The file perso.txt offers an additional customization level by providing several options for the display of personal data. The code below is somewhat self explanatory:


%import;perso_utils

%include.perso_header;

%if;(bvar.perso_module_tplnb="" or bvar.perso_module_tplnb=0)
  %apply;show_templ("perso_module/etat_civil")
  %apply;show_templ("perso_module/parent_simple")
  %apply;show_templ("perso_module/union_simple")
  %apply;show_templ("perso_module/freresoeur_simple")
  %apply;show_templ("perso_module/relations")
  %apply;show_templ("perso_module/timeline")
  %apply;show_templ("perso_module/notes")
  %apply;show_templ("perso_module/sources")
  %apply;show_templ("perso_module/arbre_3gen_v_photo")
%else;
  %for;i;0;bvar.perso_module_tplnb;
    %apply;get_templ(i)
  %end;
%end;

For most of the modules, several alternatives are available and can be selected by editing the appropriate line. here is the current cocntent of the perso_modules folder:

drwxr-xr-x  23 Henri  staff    782  1 oct 22:26 .
drwxr-xr-x  64 Henri  staff   2176 15 oct 23:56 ..
-rw-r--r--   1 Henri  staff   3979  1 oct 22:26 arbre_3gen_v.txt
-rw-r--r--   1 Henri  staff  12691  1 oct 22:26 arbre_3gen_v_photo.txt
-rw-r--r--   1 Henri  staff  10477  1 oct 22:26 arbre_4gen_v.txt
-rw-r--r--   1 Henri  staff  19592  1 oct 22:26 arbre_5gen_h.txt
-rw-r--r--   1 Henri  staff   2303  1 oct 22:26 etat_civil.txt
-rw-r--r--   1 Henri  staff   7283  1 oct 22:26 famille.txt
-rw-r--r--   1 Henri  staff   2964  1 oct 22:26 freresoeur_complet.txt
-rw-r--r--   1 Henri  staff   2972  1 oct 22:26 freresoeur_simple.txt
-rw-r--r--   1 Henri  staff   1636  1 oct 22:26 notes.txt
-rw-r--r--   1 Henri  staff    785  1 oct 22:26 parent_complet.txt
-rw-r--r--   1 Henri  staff    431  1 oct 22:26 parent_evolue.txt
-rw-r--r--   1 Henri  staff   1653  1 oct 22:26 parent_photo.txt
-rw-r--r--   1 Henri  staff    271  1 oct 22:26 parent_simple.txt
-rw-r--r--   1 Henri  staff   1877  1 oct 22:26 relations.txt
-rw-r--r--   1 Henri  staff    360  1 oct 22:26 sources.txt
-rw-r--r--   1 Henri  staff   1099  1 oct 22:26 timeline.txt
-rw-r--r--   1 Henri  staff   7374  1 oct 22:26 union_complet.txt
-rw-r--r--   1 Henri  staff   3636  1 oct 22:26 union_evolue.txt
-rw-r--r--   1 Henri  staff   2532  1 oct 22:26 union_photo.txt
-rw-r--r--   1 Henri  staff   1861  1 oct 22:26 union_simple.txt

Changing the content of perso.txt can be achieved through a set of parameters stored in the .gwf file where the value of the parameter is the name of the desired module:

perso_module_0=etat_civil
perso_module_1=parent_simple
perso_module_2=union_simple
perso_module_3=freresoeur_simple
perso_module_4=relations
perso_module_5=notes
perso_module_6=sources
perso_module_7=arbre_3gen_v_photo

One must add a last parameter specifying the total number of sub-templates

perso_module_tplnb=8

Examples

The result corresponding to each choice is as follows:


File name Content Example
etat_civil
File:etatcivil.jpg
Personal data.
parent_simple
File:parent simple.jpg
Parents (simple).
parent_evolue
File:parent evolue.jpg
Parents (more complex).
File:parent complet.jpg
Parents (full).
parent_photo
File:parent complet.jpg
Parents (with photo).
union_simple
File:parent complet.jpg
Union (simple).
union_evolue
File:parent complet.jpg
Union (complex).
union_photo
frereoeur simple Brothers and sisters (simple)
File:parent complet.jpg
Brothers and sisters (full).
frereoeur_complet
File:parent complet.jpg
Parents (full).
famille
relations
notes
sources
timeline
arbre_3gen_v
File:parent complet.jpg
Tree, vertical, 3 gen.
arbre_3gen_v_photo
File:parent complet.jpg
Tree, vertical, 3 gen, photos.
arbre_4gen_v
File:parent complet.jpg
Tree, vertical, 4 gen.
arbre_5gen_h
File:parent complet.jpg
Tree, horizontal, 5 gen.