GeneWeb

GeneWeb - Customization of pages



This part indicates how to customize the welcome pages and the other pages and to put associated pages. It is written for people having handled GeneWeb already and who want to go into the details.
bullet Welcome page
bullet Macros
bullet Associated pages
bullet Customization of all the pages

Welcome page

The welcome page is built from text files, the files "start.txt" provided with the distribution of GeneWeb. It is possible to modify these files and/or make a specific version for a given database.

These files contain HTML mixed with "macros" (see following section). If you want to create such files or modify them, do not use an HTML editor, but a normal text editor.

To build the welcome page of the base "foo", GeneWeb will look for the following files, in this order:
bulletbdir/lang/lg/foo.txt
bullethdir/lang/lg/foo.txt
bulletbdir/lang/foo.txt
bullethdir/lang/foo.txt
bulletbdir/lang/lg/start.txt
bullethdir/lang/lg/start.txt
bulletbdir/lang/start.txt
bullethdir/lang/start.txt
where:
bullet"bdir" = value of "-bd" of the command "gwd" (default: current directory).
bullet"hdir" = value of "-hd" of the command "gwd" (default: current directory).
bullet"lg" = current language.

The files "hdir/lang/lg/start.txt" are provided with the distribution. To make the custom file, the simplest way is to start from a copy of a file "start.txt" which you will arrange as you want. If the presentation of the files "start.txt" do not suit you, you can also change them directly.

Warning however: from a version of GeneWeb to the other, the files "start.txt" may have been improved. If you take a new version and want to benefit from the improvements, look at the files "start.txt" to see where they have been modified and include their modifications in your customized files.

Macros

As indicated previously, the files of welcome pages are not pure HTML. They hold "macros". They are sequences beginning with the character "%" and followed by a letter. Examples: "%s", "%x", etc.

These macros is replaced by values which depend on the context: name of the base, language, number of persons in the base, etc.

There is also a particular processing for the brackets "[" and "]": if the text between hooks is translated in the current language from the lexicon (file "lexicon.txt") with the following modifications:
bulletIf there is a star after the opening bracket, the first letter of the translation is capitalized.
bulletIf the closing bracket is followed of a number, that correspond to the N-2nd occurrence of translation (starting with 0), the occurrences being separated by slashes. If this occurrence does not exist, the first one is taken.

To understand how the macros are used, the best is to look at the files "start.txt" provided in the distribution.

Here the meanings of the macros "%":
bulletBase.
bullet"%t": name of the base.
bullet"%f": in server mode, name of the base, followed by the possible password (ex: "foo_xyzzy"); in CGI mode, name of CGI command (ex: "gwd.exe").
bullet"%g": in server mode, like "%f"; in CGI mode, name of CGI command followed by "?b=", the name of the base and a semicolon (ex: "gwd.exe?b=foo;").
bullet"%s": value of "%f" followed by a question mark and contextual variables (see below) followed by a semicolon. Ex: "foo?lang=it;iz=8233;".
bulletCount.
bullet"%c": number of accesses to the welcome page.
bullet"%q": number of requests.
bullet"%d": date of the first consultation.
bulletConditionals.
Conditionals start with "%I" followed by a boolean expression (true or false) and end with "%E". The text between these two macros is displayed if and only if the boolean expression is true. A boolean expression is either:
bullet"f" : we are "friend"
bullet"w" : we are "wizard"
bullet"j" : we are "wizard" just "friend" (cf file a.gwf, "wizard_just_friend")
bullet"c" : we are in cgi mode
bullet"h" : there is a history file
bullet"l" : the browser does not treat tables
bullet"n" : there are notes for the database
bullet"t" : there is a search by nobility titles
bullet"z" : there is a person selected as Sosa reference (see macro "%u")
bullet"a" : there is a global access restriction for the database
bullet"N" : contrary of the following expression
bullet"|" : logical "or" between the two following expressions
bullet"&" : logical "and" between the two following expressions
Examples:
bullet display the text if there is a search by title: %It...%E
bullet display the text if we are neither "wizard" nor "friend": %I&NwNf...%E
bulletOthers.
bullet"%r" followed by a name and a new line: inclusion of the file "name.txt".
bullet"%b": value of the variable "body_prop" of the file "foo.gwf" for the base "foo".
bullet"%h": contextual variables (see below) in the form "< input type=hidden name=var value=val>".
bullet"%l": language.
bullet"%n": number of persons in the database.
bullet"%u" : person selected as Sosa reference.
bullet"%%": only one "%".
bullet"%[": "[".
bullet"%]": "]".

Some macros refer to contextual variables. They are:
bulletb: in CGI mode, database name.
bulletlang: language.
bulletiz: number of the person taken as Sosa reference if any.

Associated pages

In your customized welcome page, you can put links to associated files which will be treated by GeneWeb in the same way: the macros will be transformed.

For example, if you want to put a special page of the famous persons of your base, make a file named "famous.txt" in the directory "bdir/lang/lg" or in the directory "bdir/lang" (see first section).

The request of access to "famous.txt" is: "m=H;v=famous". In the welcome page, you will thus put:

   <a href="%sm=H;v=famous">Famous</a> persons of my
   database.

In "famous.txt", you can put links to persons of your base, independently from his name and from the context, using the appropriate macros.

The particularly interesting macros are:
bullet"%b" you can put in the tag "<body>" writing it "<body%b>".
bullet"%s" you can use in links.
Example of sentence in "famous.txt":

   See my cousin <a href="%sp=louis;n=de+bourbon;oc=5">
   Louis XIV</a> and my
   <a href="%sem=R;ep=john;en=smith;m=NG;n=louis+xiv;t=PN">
   relationship links</a> with him.

See how to make correct links to GeneWeb pages as well.

Notice that the "advanced request" works like an associated file named "advanced.txt".

All the pages

The pages, the welcome page included, can be customized in three places:
bulletYou can add a file named base.hed (if "base" is the name of your database) which will be inserted in all the headers of the pages (between <head> and </head>). Allow you to insert style sheets for example. To be put in the directory "lang" and/or if you want that it be different for the language "xy" in the directory "lang/xy".
bulletIn the same way, you can add a file named base.trl which will be inserted behind the GeneWeb copyright at each page.
bulletAt last, you can set the variable body_prop of your file base.gwf which will be inserted in the tag "<body>" of all the pages. Useful to put a background color or image or to change the colours of the displayed texts. See this section of the chapter "how to start with GeneWeb".


Return to Directions for Use

© Copyright 2001 INRIA - GeneWeb