GeneWeb proposed a general purpose mechanism allowing the user/programmer to extend at will the notion of variable described here.

+

+

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>

Return to[[Manual]]

Return to[[Manual]]

Revision as of 17:52, 31 October 2015

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. It contains variables controlling the behavior of the gwd program.
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 templmtemplate.

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

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 {{{1}}} directly in the URL window of your browser.

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_diff indicates that detailed modifications are logged for each person (à la wiki).

Environment variables, bvar, evar

GeneWeb proposed a general purpose mechanism allowing the user/programmer to extend at will the notion of variable described here.

If a new variable is defined in the .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 .gwf, then the following code in the template will be able to perform some specific action: