Difference between revisions of "configuration"

From GeneWeb
Jump to: navigation, search
(added evar and bvar)
(Caveat for version 7 file/folders organisation)
 
(13 intermediate revisions by 3 users not shown)
Line 2: Line 2:
 
{{languages|Configuration}}
 
{{languages|Configuration}}
  
The configuration file for a given base is a text file with extension {{c|.gwf}} bearing the same name as your base and sitting next to the {{c|basename.gwb}} folder. It contains variables controlling the behavior of the {{c|gwd}} program.
+
The '''configuration''' file for a given base is a text file with extension {{c|.gwf}} bearing the same name as your base and sitting next to the {{c|basename.gwb}} folder.
 +
 
 +
If and when the file organisation of GeneWeb is modified (in version 7.xx, no calendar yet), this file will be in {{c|basename.gwb/etc/config.txt}}.
 +
 
 +
It contains variables controlling the behaviour of the {{c|gwd}} program and of the template mechanism.
 
If no configuration file is supplied, gwd will fall back on a standard configuration located at {{c|bindir/gw/a.gwf}}. This {{git|etc|a.gwf}} file contains all variables with some description of their actions, some being commented out. Additional files may provide other configuration variables as for the {{c|templm}} [[templates|template]].
 
If no configuration file is supplied, gwd will fall back on a standard configuration located at {{c|bindir/gw/a.gwf}}. This {{git|etc|a.gwf}} file contains all variables with some description of their actions, some being commented out. Additional files may provide other configuration variables as for the {{c|templm}} [[templates|template]].
  
 
If you create a fresh base with [[gwsetup]], you will be proposed the following default simpler configuration file:
 
If you create a fresh base with [[gwsetup]], you will be proposed the following default simpler configuration file:
 
<pre>
 
<pre>
 +
use_cdn=yes
 
access_by_key=yes
 
access_by_key=yes
 
disable_forum=yes
 
disable_forum=yes
Line 26: Line 31:
 
full_siblings=yes
 
full_siblings=yes
 
hide_advanced_request=no
 
hide_advanced_request=no
 +
 +
perso_module_0=individual
 +
perso_module_1=parents
 +
perso_module_2=unions
 +
perso_module_3=fratrie
 +
perso_module_4=relations
 +
perso_module_5=notes
 +
perso_module_6=sources
 +
perso_module_7=arbres
 +
perso_module_8=chronologie
 +
perso_module_9=gr_parents
 +
perso_module_10=ligne
 +
 +
perso_module_i=individual
 +
perso_module_p=parents
 +
perso_module_u=unions
 +
perso_module_f=fratrie
 +
perso_module_r=relations
 +
perso_module_c=chronologie
 +
perso_module_n=notes
 +
perso_module_s=sources
 +
perso_module_a=arbres
 +
perso_module_g=gr_parents
 +
perso_module_d=data_3col
 +
perso_module_l=ligne
 
</pre>
 
</pre>
  
 
The gwsetup base creation interface allows direct modification of several of the variables above.
 
The gwsetup base creation interface allows direct modification of several of the variables above.
 +
 +
The [[templm]] template offers an additional set of parameters.
  
 
== Detailed description of variables ==
 
== Detailed description of variables ==
Line 34: Line 66:
 
This description is limited to some important variables. For others, see {{c|a.gwf}}.
 
This description is limited to some important variables. For others, see {{c|a.gwf}}.
  
* '''body_prop''' content of the %b [[macros|macro]] typically inserted in the "<body>" HTML tag. Syy your HTML documentation for details.
+
* '''body_prop''' content of the %b [[macros|macro]] typically inserted in the <body>HTML tag. See your HTML documentation for details.
 
Example:
 
Example:
 
  body_prop=background=monfond.jpg vlink=yellow
 
  body_prop=background=monfond.jpg vlink=yellow
Line 40: Line 72:
 
:This applies to '''all pages''' produced by GeneWeb.
 
:This applies to '''all pages''' produced by GeneWeb.
  
* '''friend_passwd''' allows global access control for persons potentially still alive. See {{c|private_years}} in {{c|a.gwf}}. defualt value is 150 years.
+
* '''friend_passwd''' allows global access control for persons potentially still alive. See {{c|private_years}} in {{c|a.gwf}}. Default value is 150 years.
: If a value is supplied for this variable, only visitors having entered that value as password will see data about persons born less than "private_years" years.
+
: If a value is supplied for this variable, only visitors having entered that value as password will see data about persons born less than “private_years” years.
 
: '''friend_passwd_file''' allows for a user level access control.
 
: '''friend_passwd_file''' allows for a user level access control.
  
 
* '''wizard_passwd''' allows global access control to modification rights in the base.
 
* '''wizard_passwd''' allows global access control to modification rights in the base.
: If a value is supplied for this variable, only visitors having entered that valus as password will have modification rights.
+
: If a value is supplied for this variable, only visitors having entered that value as password will have modification rights.
 
: '''wizard_passwd_file''' allows for a user level access control.
 
: '''wizard_passwd_file''' allows for a user level access control.
  
Line 51: Line 83:
  
 
* '''default_lang''' specifies the default language. Default value is french. Possibilities are: "af" (afrikaans), "bg" (bulgaran), "br" (breton), "cs" (czech), "ca" (catalan), "de" (greman), "da" (danish), "en" (english), "eo" (espéranto), "es" (spanish), "et" (estonian), "fi" (finnish), "fr" (french), "he" (hebrew), "is" (icelandic), "it" (italian), "lv" (latvian), "nl" (dutch), "no" (norvegian), "pl" (polish), "pt" (portugeese), "pt-br" (bresilian portugeese), "ro" (romanian), "ru" (russian), "sl" (slovenian), "sv" (sueedish), "zh" (chineese),
 
* '''default_lang''' specifies the default language. Default value is french. Possibilities are: "af" (afrikaans), "bg" (bulgaran), "br" (breton), "cs" (czech), "ca" (catalan), "de" (greman), "da" (danish), "en" (english), "eo" (espéranto), "es" (spanish), "et" (estonian), "fi" (finnish), "fr" (french), "he" (hebrew), "is" (icelandic), "it" (italian), "lv" (latvian), "nl" (dutch), "no" (norvegian), "pl" (polish), "pt" (portugeese), "pt-br" (bresilian portugeese), "ro" (romanian), "ru" (russian), "sl" (slovenian), "sv" (sueedish), "zh" (chineese),
:Note that at any time, independant of this setting, you may change the inetrface language by clicking on the appropriate flag of the welcome page (unless you have edited it out!), or by inserting {{c|lang=ln}} directly in the URL window of your browser.
+
:Note that at any time, independant of this setting, you may change the inetrface language by clicking on the appropriate flag of the welcome page (unless you have edited it out!), or by inserting {{c|1=lang=ln}} directly in the URL window of your browser.
  
* '''can_send_image''' allows wizards to send or modify images associated with persons. See [[Update]]. Default value is "no"; to allow, enter "yes".
+
* '''can_send_image''' allows wizards to send or modify images associated with persons. See [[Update]]. Default value is “no”; to allow, enter “yes”.
 
: Those images may take some space; manage carefully.
 
: Those images may take some space; manage carefully.
  
 
* '''renamed''' indicates a new name for this base (useful if many links into your base exist on the web. A page with the new link will be displayed for the user to copy/paste and to follow to the content of his request.
 
* '''renamed''' indicates a new name for this base (useful if many links into your base exist on the web. A page with the new link will be displayed for the user to copy/paste and to follow to the content of his request.
  
* '''history''' indicates that your base logs modification to its content (kept in {{c|bases/basename.gwb/history) and visible from the welcome page if the file exists.
+
* '''history''' indicates that your base logs modification to its content (kept in {{c|bases/basename.gwb/history}}) and visible from the welcome page if the file exists.
  
 
* '''history_diff''' indicates that detailed modifications are logged for each person (à la wiki).
 
* '''history_diff''' indicates that detailed modifications are logged for each person (à la wiki).
Line 64: Line 96:
 
== Environment variables, bvar, evar ==
 
== Environment variables, bvar, evar ==
  
GeneWeb proposed a general purpose mechanism allowing the user/programmer to extend at will the notion of variable described here.
+
See the [[expert#Variables (evar and bvar)|experts]] section for a discussion on these users supplied variables.
 
+
If a new variable is defined in the {{c|.gwf}} configuration file, then it will be possible to test for the value of this variable in the context of a template file. For instance, if we have added
+
new_var=some-text
+
in {{c|.gwf}}, then the following code in the template will be able to perform some specific action:
+
%if; (bvar.new_var = "sometext" )  
+
    ... perform some specific action ...
+
%end;
+
 
+
Similarly, if we have added a new variable in the URL of the query to GeneWeb ({{c|localhost:2317/base?p=first-name;n=last-name;lang=fr;tree=3}}, then it is possible to test for this variable with code such as:
+
 
+
%if; (evar.tree = 3 )
+
    ... display 3 generation tree ...
+
%end;
+
 
+
The value itself of such variables can be inserted in the body of a template by typing {{c|%evar.tree;}}, for instance
+
  
<nowiki><title>Tree with %evar.tree; generations</title></nowiki>
+
{{manual}}
  
Return to[[Manual]]
+
[[Category:Manual]]

Latest revision as of 18:53, 4 October 2020

150px-Geographylogo svg.png Language: English • français

The configuration file for a given base is a text file with extension .gwf bearing the same name as your base and sitting next to the basename.gwb folder.

If and when the file organisation of GeneWeb is modified (in version 7.xx, no calendar yet), this file will be in basename.gwb/etc/config.txt.

It contains variables controlling the behaviour of the gwd program and of the template mechanism. If no configuration file is supplied, gwd will fall back on a standard configuration located at bindir/gw/a.gwf. This a.gwf file contains all variables with some description of their actions, some being commented out. Additional files may provide other configuration variables as for the templm template.

If you create a fresh base with gwsetup, you will be proposed the following default simpler configuration file:

use_cdn=yes
access_by_key=yes
disable_forum=yes
hide_private_names=no
use_restrict=no
show_consang=yes
display_sosa=yes
place_surname_link_to_ind=yes
max_anc_level=8
max_anc_tree=7
max_desc_level=12
max_desc_tree=4
max_cousins=2000
max_cousins_level=5
latest_event=20
template=*
long_date=no
counter=no
full_siblings=yes
hide_advanced_request=no

perso_module_0=individual
perso_module_1=parents
perso_module_2=unions
perso_module_3=fratrie
perso_module_4=relations
perso_module_5=notes
perso_module_6=sources
perso_module_7=arbres
perso_module_8=chronologie
perso_module_9=gr_parents
perso_module_10=ligne

perso_module_i=individual
perso_module_p=parents
perso_module_u=unions
perso_module_f=fratrie
perso_module_r=relations
perso_module_c=chronologie
perso_module_n=notes
perso_module_s=sources
perso_module_a=arbres
perso_module_g=gr_parents
perso_module_d=data_3col
perso_module_l=ligne

The gwsetup base creation interface allows direct modification of several of the variables above.

The templm template offers an additional set of parameters.

Detailed description of variables

This description is limited to some important variables. For others, see a.gwf.

  • body_prop content of the %b macro typically inserted in the “<body>” HTML tag. See your HTML documentation for details.

Example:

body_prop=background=monfond.jpg vlink=yellow
This applies to all pages produced by GeneWeb.
  • friend_passwd allows global access control for persons potentially still alive. See private_years in a.gwf. Default value is 150 years.
If a value is supplied for this variable, only visitors having entered that value as password will see data about persons born less than “private_years” years.
friend_passwd_file allows for a user level access control.
  • wizard_passwd allows global access control to modification rights in the base.
If a value is supplied for this variable, only visitors having entered that value as password will have modification rights.
wizard_passwd_file allows for a user level access control.
  • wizard_just_friend allows to temporarily prevent modifications
  • default_lang specifies the default language. Default value is french. Possibilities are: "af" (afrikaans), "bg" (bulgaran), "br" (breton), "cs" (czech), "ca" (catalan), "de" (greman), "da" (danish), "en" (english), "eo" (espéranto), "es" (spanish), "et" (estonian), "fi" (finnish), "fr" (french), "he" (hebrew), "is" (icelandic), "it" (italian), "lv" (latvian), "nl" (dutch), "no" (norvegian), "pl" (polish), "pt" (portugeese), "pt-br" (bresilian portugeese), "ro" (romanian), "ru" (russian), "sl" (slovenian), "sv" (sueedish), "zh" (chineese),
Note that at any time, independant of this setting, you may change the inetrface language by clicking on the appropriate flag of the welcome page (unless you have edited it out!), or by inserting lang=ln directly in the URL window of your browser.
  • can_send_image allows wizards to send or modify images associated with persons. See Update. Default value is “no”; to allow, enter “yes”.
Those images may take some space; manage carefully.
  • renamed indicates a new name for this base (useful if many links into your base exist on the web. A page with the new link will be displayed for the user to copy/paste and to follow to the content of his request.
  • history indicates that your base logs modification to its content (kept in bases/basename.gwb/history) and visible from the welcome page if the file exists.
  • history_diff indicates that detailed modifications are logged for each person (à la wiki).

Environment variables, bvar, evar

See the experts section for a discussion on these users supplied variables.


GeneWeb Manual

Rembrandt Old Man Reading a Book.jpg

Use and manage genealogical databases

Technical annex