Difference between revisions of "expert"

From GeneWeb
Jump to: navigation, search
(Template programming (%if; ... %end;))
(evar)
 
(51 intermediate revisions by 4 users not shown)
Line 5: Line 5:
  
 
The template mechanism provides a very powerful mechanism to construct HTML (or other) pages according to the content of a GeneWeb base.
 
The template mechanism provides a very powerful mechanism to construct HTML (or other) pages according to the content of a GeneWeb base.
This section is not intending to give an exhaustive description of the corresponding language. Through some examples extracted from {{c|gw/etc/perso.txt}}, it provides a glimpse of the possibility. For further analysis, explore the various other [[templates|template]] files, and on last resort, explore the Ocaml source files!!
+
This section is not intending to give an exhaustive description of the corresponding language. Through some examples extracted from {{c|gw/etc/perso.txt}}, it provides a glimpse of the possibility. The last two examples are extracted from a template that generates LaTeX rather than HTML.
 +
 
 +
For further analysis, explore the various other [[templates|template]] files, and on last resort, explore the Ocaml source files!!
 +
 
 +
WARNING: one of the main issue with template programming is that all functions are not permanently available on all pages! Describing which are available where is beyond reach, and trial and error is the only solution, but being aware of the problem is important!!
 +
 
 +
Programming constructs:
 +
 
 +
  %define(p1, p2) ... %end;
 +
  %if;(cond) [%elseif;] [%else;] %end;
 +
  %let;xxx;zzz%in;
 +
  %foreach; ... %end;
 +
  %for;i;0;n;... %end;
 +
  %apply;xxxx(p1, p2) or
 +
  %apply; ... [%with;... [%and;] ...%end;]
 +
  %nl; %nn; %sp; %sq;
 +
 
 +
Functions callable with %apply:
 +
 
 +
  a_of_b ("aaa", "bbb")
 +
  a_of_b2 ("aaa", "bbb", "ccc") test vowel at beginning of "ccc"
 +
  a_of_b_gr_eq_lev (??)
 +
  capitalize ("aaa")
 +
  language_name ("fr")
 +
  nth("aaa"/"bbb"/"ccc"/"ddd", n)
 +
  nth_c("abcdef", n)
 +
  blue_of_hsv
 +
  red_of_hsv
 +
  green_of_hsv
 +
 
 +
Arithmetic and booleans:
 +
 
 +
  +, -, /, *, %, =, !=, <, <=, >, >=, "and", "or", "not", "is_substr" or "in"
 +
 
 +
WARNING: all functions may not be fully available depending on the execution context!
  
 
   <title>%nn;
 
   <title>%nn;
Line 44: Line 78:
 
  </pre>
 
  </pre>
  
<div style="column-count:4;-moz-column-count:4;-webkit-column-count:4">
 
 
<pre>
 
<pre>
"access_by_key"
+
%define;hgindex(alxx, snxx, fnxx, occxx)
"access"  
+
  %if;(alxx = "0")
"age"
+
    %if;(occxx = "0")
"alias"  
+
      \index{snxx, fnxx}
"anc_sosa"  
+
    %else;
"ancestor_level"  
+
      \index{snxx, fnxx (occxx)}
"ancestor_level2"  
+
    %end;
"ancestor_surname"  
+
  %else;
"ancestor_tree_line"  
+
    %if;(occxx = "0")
"ancestor"  
+
      \index{alxx, voir snxx, fnxx}
"are_divorced"
+
    %else;
"are_engaged"
+
      \index{alxx, voir snxx, fnxx (occxx)}
"are_married"
+
    %end;
"are_not_married"
+
  %end;
"are_separated"
+
%end
"auto_image_file_name"
+
</pre>
"baptism_date"  
+
 
"baptism_note"
+
<pre>
"baptism_place"
+
%foreach;alias;
"baptism_witness"  
+
    {\it {\bf %alias;}}%apply;hgindex(alias, surname, first_name, occ)\\%nl;
"base"  
+
%end;
"birth_date"  
+
</pre>
"birth_note"
+
 
"birth_place"
+
=== List of commands ===
"birth_witness"  
+
This list does not claim to be exhaustive (but pretty close!!). A good way to understand the semantic of these commands is to explore the template files and observe how they are used (grep is your friend).
"birth_witness"  
+
 
"birthday"
+
Most of the commands are interpreted by the files perso.ml or templ.ml. When this is not the case, the name of the interpreter file is associated with the command.
"browsing_with_sosa_ref"
+
 
"burial_date"  
+
<div style="column-count:2;-moz-column-count:2;-webkit-column-count:2">
"burial_note"
+
<pre>
"burial_place"
+
  "a_of_b"
"burial_witness"  
+
  "a_of_b2"
"canton"
+
  "a_of_b_gr_eq_lev"
"cell"  
+
  "acc_if_titles", updateInd.ml
"child_cnt"  
+
  "acc_private", updateInd.ml
"child_name"
+
  "acc_public", updateInd.ml
"child"  
+
  "acces", historyDiffDisplay.ml
"colspan"
+
  "access", dagDisplay.ml, history.ml,
"comment"
+
      historyDiffDisplay.ml
"computable_age"
+
  "access_by_key"
"computable_death_age"
+
  "action"
"computable_marriage_age"
+
  "add_in_sorted_list"
"consanguinity"
+
  "add_in_sorted_listb"
"count"
+
  "add_in_sorted_listc"
"country"
+
  "add_in_sorted_listd"
"county"
+
  "add_in_sorted_liste"
"cousin_level"  
+
  "after", historyDiffDisplay.ml
"cremated_date"  
+
  "age"
"cremation_place"
+
  "alias", updateInd.ml
"cremation_witness"  
+
  "aliases", historyDiffDisplay.ml
"date_begin"  
+
  "align", dagDisplay.ml
"date_end"  
+
  "all"
"date"
+
  "anc1"
"dates"
+
  "anc2"
"day"
+
  "anc_f_list"
"death_age"
+
  "anc_level"
"death_date"  
+
  "anc_paths"
"death_note"
+
  "anc_paths_at_level"
"death_place"
+
  "anc_paths_at_level_cnt"
"death_witness"  
+
  "anc_paths_at_level_cnt_raw"
"desc_level"
+
  "anc_paths_cnt"
"descendant_level"  
+
  "anc_paths_cnt_raw"
"died"  
+
  "anc_sosa"
"district"
+
  "ancestor"
"divorce_date"
+
  "ancestor_at_level"
"empty_sorted_list"
+
  "ancestor_level"
"enclosing"  
+
  "ancestor_surname"
"event_witness_kind"  
+
  "ancestor_tree_line"
"event_witness_relation_kind"  
+
  "and"
"event_witness_relation"  
+
  "approx_birth_place"
"event_witness"  
+
  "approx_death_place"
"event"  
+
  "are_divorced"
"fam_access"
+
  "are_engaged"
"family_cnt"  
+
  "are_marriage_banns"
"family"  
+
  "are_marriage_contract"
"father_age_at_birth"  
+
  "are_marriage_license"
"father_sosa"
+
  "are_married"
"father"  
+
  "are_not_married"
"first_name_alias"
+
  "are_pacs"
"first_name_alias"  
+
  "are_residence"
"first_name_key_strip"
+
  "are_separated"
"first_name_key_val"
+
  "auto_image_file_name"
"first_name_key"
+
  "bapt", updateInd.ml
"first_name"
+
  "bapt_note", updateInd.ml
"has_aliases"
+
  "bapt_place", updateInd.ml
"has_baptism_date"  
+
  "bapt_src", updateInd.ml
"has_baptism_note"
+
  "baptism", historyDiffDisplay.ml
"has_baptism_place"  
+
  "baptism_date"
"has_baptism_witnesses"
+
  "baptism_note", historyDiffDisplay.ml
"has_birth_date"  
+
  "baptism_place", historyDiffDisplay.ml
"has_birth_note"
+
  "baptism_source"
"has_birth_place"  
+
  "baptism_src", historyDiffDisplay.ml
"has_birth_witnesses"
+
  "baptism_witness"
"has_burial_date"
+
  "bar_link", dagDisplay.ml
"has_burial_note"
+
  "base", srcfileDisplay.ml
"has_burial_place"  
+
  "base_header"
"has_burial_witnesses"
+
  "base_trailer"
"has_children"
+
  "bases_list"
"has_comment"
+
  "bdo", dagDisplay.ml
"has_consanguinity"
+
  "before", historyDiffDisplay.ml
"has_cremation_date"
+
  "birth", historyDiffDisplay.ml, updateInd.ml
"has_cremation_place"  
+
  "birth_date"
"has_cremation_witnesses"
+
  "birth_day", updateFam.ml
"has_date" e
+
  "birth_month", updateFam.ml
"has_death_date"
+
  "birth_note", historyDiffDisplay.ml, updateInd.ml
"has_death_note"
+
  "birth_place", historyDiffDisplay.ml,
"has_death_place"  
+
      updateFam.ml, updateInd.ml
"has_death_witnesses"
+
  "birth_source"
"has_event"
+
  "birth_src", historyDiffDisplay.ml, updateInd.ml
"has_families"  
+
  "birth_witness"
"has_first_names_aliases"
+
  "birth_year", updateFam.ml
"has_fsources"
+
  "birthday"
"has_history"
+
  "blue_of_hsv"
"has_image"  
+
  "bname_prefix"
"has_linked_page"
+
  "body_prop"
"has_linked_pages"
+
  "border"
"has_marriage_note"
+
  "browsing_with_sosa_ref", dagDisplay.ml,
"has_nephews_or_nieces"  
+
      srcfileDisplay.ml
"has_nobility_titles"  
+
  "bt_buried", updateInd.ml
"has_note"  
+
  "bt_cremated", updateInd.ml
"has_notes" "
+
  "bt_unknown_burial", updateInd.ml
"has_occupation"  
+
  "burial", historyDiffDisplay.ml, updateInd.ml
"has_parents"  
+
  "burial_date"
"has_place"
+
  "burial_note", historyDiffDisplay.ml, updateInd.ml
"has_possible_duplications"  
+
  "burial_place", historyDiffDisplay.ml, updateInd.ml
"has_psources"
+
  "burial_source"
"has_public_name"
+
  "burial_src", historyDiffDisplay.ml, updateInd.ml
"has_qualifiers"
+
  "burial_witness"
"has_relation_her"
+
  "bvar", updateFam.ml
"has_relation_him"
+
  "cal_french", update_util.ml
"has_relations"
+
  "cal_gregorian", update_util.ml
"has_siblings"
+
  "cal_hebrew", update_util.ml
"has_sosa"
+
  "cal_julian", update_util.ml
"has_sources"
+
  "calendar", update_util.ml
"has_spouse" e
+
  "cancel_links"
"has_src"  
+
  "canton", util.ml
"has_surnames_aliases"
+
  "capitalize"
"has_witnesses"
+
  "cell"
"has_witnesses"  
+
  "cell_nbr", dagDisplay.ml
"hexa"  
+
  "center", dagDisplay.ml
"history_file"
+
  "cgi"
"ident_key"  
+
  "charset"
"image_html_url"  
+
  "child", updateFam.ml
"image_medium_size" s
+
  "child_cnt"
"image_size"  
+
  "child_name"
"image_small_size"  
+
  "children", historyDiffDisplay.ml
"image_url"  
+
  "clean_comment_tags"
"image" if
+
  "clean_html_tags"
"incr_count"
+
  "cnt", updateDataDisplay.ml, updateFam.ml, updateInd.ml
"ind_access"
+
  "colspan", dagDisplay.ml
"index"  
+
  "comment", historyDiffDisplay.ml, updateFam.ml
"index"  
+
  "computable_age"
"interval"
+
  "computable_death_age"
"is_buried"
+
  "computable_marriage_age"
"is_center"
+
  "connections"
"is_cremated"
+
  "consanguinity"
"is_dead"
+
  "copyright"
"is_descendant"
+
  "count", history.ml, updateDataDisplay.ml
"is_empty"
+
  "count1"
"is_female"  
+
  "count2"
"is_first"
+
  "count3"
"is_invisible"
+
  "country", util.ml
"is_last"
+
  "county", util.ml
"is_left"
+
  "cous_paths"
"is_male" e
+
  "cous_paths_cnt"
"is_no_mention"
+
  "cous_paths_cnt_raw"
"is_no_sexes_check"
+
  "cous_paths_max_date"
"is_private"  
+
  "cous_paths_min_date"
"is_public"  
+
  "cousin"
"is_restricted"  
+
  "cousin_level"
"is_right"
+
  "cousins"
"is_self" get_env
+
  "cousins_cnt"
"is_sibling_after"  
+
  "create", updateFam.ml, updateInd.ml, updateIndOk.ml,
"is_sibling_before"  
+
      update_util.ml
"is_top"
+
  "cremated_date"
"item"  
+
  "cremation_place"
"lazy_force"
+
  "cremation_witness"
"lazy_printed"
+
  "dag", dagDisplay.ml
"level"
+
  "dag_cell", dagDisplay.ml
"linked_page"
+
  "dag_cell_pre", dagDisplay.ml
"mark_descendants"
+
  "dag_line", dagDisplay.ml
"marriage_age"
+
  "dag_line_pre", dagDisplay.ml
"marriage_date"  
+
  "date", historyDiffDisplay.ml, hutil.ml
"marriage_note"
+
  "date_begin"
"marriage_place"
+
  "date_end"
"max_anc_level"
+
  "date_s"
"max_cous_level"
+
  "dates", history.ml
"max_desc_level"
+
  "day", templDate.ml, update_util.ml
"misc_names"
+
  "day2"
"month"
+
  "ddmmyyyy", dateDisplay.ml
"mother_age_at_birth"  
+
  "dead_dont_know_when", updateInd.ml
"mother_sosa"
+
  "death", historyDiffDisplay.ml, updateInd.ml
"mother"  
+
  "death_age"
"name"
+
  "death_date"
"nb_children"
+
  "death_day", updateFam.ml
"nb_events"  
+
  "death_month", updateFam.ml
"nb_families"  
+
  "death_note", historyDiffDisplay.ml, updateInd.ml
"nb_ind"
+
  "death_place", historyDiffDisplay.ml, updateFam.ml,
"nb_times"  
+
      updateInd.ml
"next_item"  
+
  "death_source"
"nobility_title"
+
  "death_src", historyDiffDisplay.ml, updateInd.ml
"note"
+
  "death_witness"
"notes"
+
  "death_year", updateFam.ml
"number_of_ancestors"  
+
  "debug"
"number_of_descendants"  
+
  "desc_cnt"
"number_of_subitems"
+
  "desc_level"
"occ"
+
  "desc_paths"
"occupation"
+
  "desc_paths_at_level"
"octal"
+
  "desc_paths_at_level_cnt"
"on_baptism_date"
+
  "desc_paths_at_level_cnt_raw"
"on_birth_date"
+
  "desc_paths_cnt"
"on_burial_date"
+
  "desc_paths_cnt_raw"
"on_cremation_date"
+
  "descendant"
"on_date"
+
  "descendant_cnt"
"on_death_date"
+
  "descendant_level"
"on_marriage_date"
+
  "died"
"origin_file"
+
  "died_young", updateInd.ml
"other"
+
  "digest", updateFam.ml, updateInd.ml
"parent"  
+
  "district", util.ml
"place_key"  
+
  "divorce", historyDiffDisplay.ml, updateFam.ml
"place"
+
  "divorce_date"
"prec"
+
  "dmyyyy", dateDisplay.ml
"prev_fam_father"
+
  "doctype"
"prev_fam_index"
+
  "dont_know_if_dead", updateInd.ml
"prev_fam_mother"
+
  "dr_disappeared", updateInd.ml
"prev_family"  
+
  "dr_executed", updateInd.ml
"prev_item"  
+
  "dr_killed", updateInd.ml
"public_name"
+
  "dr_murdered", updateInd.ml
"pvar"  
+
  "dr_unspecified", updateInd.ml
"qualifier"
+
  "e_name", updateFam.ml, updateInd.ml
"region"
+
  "e_note", updateFam.ml, updateInd.ml
"related_type"
+
  "e_place", updateFam.ml, updateInd.ml
"related"  
+
  "e_src", updateFam.ml, updateInd.ml
"relation_her"  
+
  "empty_sorted_list"
"relation_him"  
+
  "empty_sorted_listb"
"relation_type"
+
  "empty_sorted_listc"
"relation"  
+
  "empty_sorted_listd"
"reset_count"
+
  "empty_sorted_liste"
"reset_desc_level"
+
  "enclosing"
"same"  
+
  "encode", updateDataDisplay.ml
"self"  
+
  "entry", updateDataDisplay.ml
"set_infinite_desc_level"
+
  "entry_ini", updateDataDisplay.ml
"sex"
+
  "entry_key", updateDataDisplay.ml
"slash_baptism_date"
+
  "entry_value", updateDataDisplay.ml
"slash_birth_date"
+
  "entry_value_rev", updateDataDisplay.ml
"slash_burial_date"
+
  "env"
"slash_cremation_date"
+
  "env_binding"
"slash_death_date"
+
  "evar", historyDiffDisplay.ml, updateDataDisplay.ml
"slash_divorce_date"
+
  "evar_cur"
"slash_marriage_date"
+
  "event", updateFam.ml, updateInd.ml
"sorted_list_item"  
+
  "event_date", updateFam.ml, updateInd.ml
"sosa_access"
+
  "event_str", updateFam.ml, updateInd.ml
"sosa_in_list"
+
  "event_witness"
"sosa_link"
+
  "event_witness_kind"
"sosa_ref"  
+
  "event_witness_relation"
"sosa"  
+
  "event_witness_relation_kind"
"source_type"
+
  "f_of_index"
"source"
+
  "false"
"spouse"  
+
  "family", historyDiffDisplay.ml
"src"
+
  "family_cnt"
"surname_alias"
+
  "father", dagDisplay.ml, updateFam.ml
"surname_begin"
+
  "father_age_at_birth"
"surname_end"
+
  "father_sosa"
"surname_key_strip"
+
  "fevent", historyDiffDisplay.ml, updateFam.ml
"surname_key_val"
+
  "fevent_date", historyDiffDisplay.ml
"surname_key"
+
  "fevent_name", historyDiffDisplay.ml
"surname"
+
  "fevent_note", historyDiffDisplay.ml
"title"  
+
  "fevent_place", historyDiffDisplay.ml
"town"
+
  "fevent_src", historyDiffDisplay.ml
"township"
+
  "fevent_witness", historyDiffDisplay.ml
"v"  
+
  "first", updateDataDisplay.ml
"var"  
+
  "first_name", history.ml, historyDiffDisplay.ml,
"wedding_birthday"
+
      updateFam.ml, updateInd.ml
"witness_relation"  
+
  "first_name_alias", updateInd.ml
"witness"  
+
  "first_name_key"
"year"
+
  "first_name_key_strip"
 +
  "first_name_key_val"
 +
  "first_names_aliases", historyDiffDisplay.ml
 +
  "found", history.ml
 +
  "french", templDate.ml
 +
  "friend"
 +
  "fsources", historyDiffDisplay.ml, updateFam.ml
 +
  "fwitness", updateFam.ml
 +
  "fwitness_kind", updateFam.ml
 +
  "get_var", dagDisplay.ml
 +
  "green_of_hsv"
 +
  "gregorian", templDate.ml
 +
  "has_aliases", updateInd.ml
 +
  "has_approx_birth_date"
 +
  "has_approx_birth_place"
 +
  "has_approx_death_date"
 +
  "has_approx_death_place"
 +
  "has_baptism_date"
 +
  "has_baptism_note"
 +
  "has_baptism_place"
 +
  "has_baptism_source"
 +
  "has_baptism_witnesses"
 +
  "has_birth_date", updateInd.ml
 +
  "has_birth_note"
 +
  "has_birth_place"
 +
  "has_birth_source"
 +
  "has_birth_witnesses"
 +
  "has_burial_date"
 +
  "has_burial_note"
 +
  "has_burial_place"
 +
  "has_burial_source"
 +
  "has_burial_witnesses"
 +
  "has_children"
 +
  "has_comment"
 +
  "has_consanguinity"
 +
  "has_cremation_date"
 +
  "has_cremation_place"
 +
  "has_cremation_witnesses"
 +
  "has_date"
 +
  "has_death_date"
 +
  "has_death_note"
 +
  "has_death_place"
 +
  "has_death_source"
 +
  "has_death_witnesses"
 +
  "has_event"
 +
  "has_families"
 +
  "has_fevents", updateFam.ml
 +
  "has_first_names_aliases", updateInd.ml
 +
  "has_fsources"
 +
  "has_fwitness", updateFam.ml
 +
  "has_history", history.ml, srcfileDisplay.ml
 +
  "has_image"
 +
  "has_image_url"
 +
  "has_linked_page"
 +
  "has_linked_pages"
 +
  "has_marriage_note"
 +
  "has_marriage_source"
 +
  "has_misc_notes", srcfileDisplay.ml
 +
  "has_nephews_or_nieces"
 +
  "has_next_sibling", dagDisplay.ml
 +
  "has_nobility_titles"
 +
  "has_note"
 +
  "has_notes", srcfileDisplay.ml
 +
  "has_occupation"
 +
  "has_parents"
 +
  "has_pevent_baptism", updateInd.ml
 +
  "has_pevent_birth", updateInd.ml
 +
  "has_pevent_burial", updateInd.ml
 +
  "has_pevent_cremation", updateInd.ml
 +
  "has_pevent_death", updateInd.ml
 +
  "has_pevents", updateInd.ml
 +
  "has_place"
 +
  "has_possible_duplications"
 +
  "has_prev_sibling", dagDisplay.ml
 +
  "has_primary_pevents", updateInd.ml
 +
  "has_psources"
 +
  "has_public_name"
 +
  "has_qualifiers", updateInd.ml
 +
  "has_referer"
 +
  "has_relation_her"
 +
  "has_relation_him"
 +
  "has_relations", updateInd.ml
 +
  "has_secondary_pevents", updateInd.ml
 +
  "has_siblings"
 +
  "has_sosa"
 +
  "has_sources"
 +
  "has_spouse"
 +
  "has_src"
 +
  "has_surnames_aliases", updateInd.ml
 +
  "has_titles", updateInd.ml
 +
  "has_witness", updateInd.ml
 +
  "has_witnesses"
 +
  "head_title", dagDisplay.ml
 +
  "hebrew", templDate.ml
 +
  "hexa"
 +
  "hidden"
 +
  "highlight"
 +
  "himher", updateFam.ml
 +
  "history_file", history.ml
 +
  "history_len", historyDiffDisplay.ml
 +
  "history_line", history.ml, historyDiffDisplay.ml
 +
  "hour", templDate.ml
 +
  "hours"
 +
  "ident"
 +
  "ident_key"
 +
  "image", historyDiffDisplay.ml, updateInd.ml
 +
  "image_html_url"
 +
  "image_medium_size"
 +
  "image_prefix"
 +
  "image_size"
 +
  "image_small_size"
 +
  "image_url"
 +
  "include"
 +
  "include_perso_header", updateFam.ml, updateInd.ml
 +
  "incr_count", history.ml, updateDataDisplay.ml
 +
  "incr_count1"
 +
  "incr_count2"
 +
  "incr_count3"
 +
  "incr_next_pevent", updateInd.ml
 +
  "index", dagDisplay.ml, templDate.ml, updateInd.ml
 +
  "ini", updateDataDisplay.ml
 +
  "init", srcfileDisplay.ml
 +
  "init_cache"
 +
  "initial", updateDataDisplay.ml
 +
  "integer", hutil.ml
 +
  "integer_range", hutil.ml
 +
  "interp"
 +
  "interval"
 +
  "is_bar", dagDisplay.ml
 +
  "is_buried"
 +
  "is_center"
 +
  "is_certainly_dead"
 +
  "is_cremated"
 +
  "is_dead"
 +
  "is_descendant"
 +
  "is_empty"
 +
  "is_female", updateInd.ml
 +
  "is_first", dagDisplay.ml, updateFam.ml, updateInd.ml
 +
  "is_hr", dagDisplay.ml
 +
  "is_hr_center", dagDisplay.ml
 +
  "is_hr_left", dagDisplay.ml
 +
  "is_hr_right", dagDisplay.ml
 +
  "is_invisible", history.ml
 +
  "is_last", dagDisplay.ml, updateFam.ml, updateInd.ml
 +
  "is_left"
 +
  "is_main"
 +
  "is_male", updateInd.ml
 +
  "is_modified", updateDataDisplay.ml
 +
  "is_no_mention"
 +
  "is_no_sexes_check"
 +
  "is_note", history.ml
 +
  "is_nothing", dagDisplay.ml
 +
  "is_printed_by_template"
 +
  "is_private"
 +
  "is_public"
 +
  "is_restricted"
 +
  "is_right"
 +
  "is_self"
 +
  "is_sibling_after"
 +
  "is_sibling_before"
 +
  "is_substr"
 +
  "is_top"
 +
  "item", dagDisplay.ml
 +
  "iz"
 +
  "julian", templDate.ml
 +
  "julian_day", templDate.ml
 +
  "just_friend_wizard"
 +
  "key", history.ml
 +
  "lang"
 +
  "language_name"
 +
  "lazy_force"
 +
  "lazy_print"
 +
  "lazy_printed"
 +
  "left"
 +
  "length", updateDataDisplay.ml
 +
  "lev_cnt"
 +
  "level"
 +
  "line", historyDiffDisplay.ml
 +
  "line_nbr", dagDisplay.ml
 +
  "link", updateInd.ml
 +
  "link_next", dagDisplay.ml
 +
  "linked_page"
 +
  "list_size"
 +
  "listb_size"
 +
  "listc_size"
 +
  "listd_size"
 +
  "liste_size"
 +
  "lvl"
 +
  "manitou"
 +
  "mark_descendants"
 +
  "marriage", historyDiffDisplay.ml, updateFam.ml
 +
  "marriage_age"
 +
  "marriage_date"
 +
  "marriage_note", updateFam.ml
 +
  "marriage_place", historyDiffDisplay.ml, updateFam.ml
 +
  "marriage_places"
 +
  "marriage_source"
 +
  "marriage_src", historyDiffDisplay.ml, updateFam.ml
 +
  "marriage_type", historyDiffDisplay.ml
 +
  "max", dagDisplay.ml, updateDataDisplay.ml
 +
  "max_a"
 +
  "max_anc_level"
 +
  "max_cous_level"
 +
  "max_d"
 +
  "max_desc_level"
 +
  "max_wid", dagDisplay.ml
 +
  "message_to_wizard"
 +
  "min", dagDisplay.ml
 +
  "min_wid", dagDisplay.ml
 +
  "minute", templDate.ml
 +
  "minutes"
 +
  "misc_names"
 +
  "mmddyyyy", dateDisplay.ml
 +
  "mn", history.ml
 +
  "mode"
 +
  "month", templDate.ml, update_util.ml
 +
  "month2"
 +
  "moon_age", templDate.ml
 +
  "moon_phase", templDate.ml
 +
  "mother", dagDisplay.ml
 +
  "mother_age_at_birth"
 +
  "mother_sosa"
 +
  "mrel", updateFam.ml
 +
  "name", srcfileDisplay.ml
 +
  "nb_accesses", srcfileDisplay.ml
 +
  "nb_accesses_to_welcome", srcfileDisplay.ml
 +
  "nb_children"
 +
  "nb_children_total"
 +
  "nb_events"
 +
  "nb_families", historyDiffDisplay.ml
 +
  "nb_fevents", updateFam.ml
 +
  "nb_ind"
 +
  "nb_persons", srcfileDisplay.ml
 +
  "nb_pevents", updateInd.ml
 +
  "nb_results", updateDataDisplay.ml
 +
  "nb_times"
 +
  "nb_witnesses_attending"
 +
  "nb_witnesses_civilofficer"
 +
  "nb_witnesses_godparent"
 +
  "nb_witnesses_informant"
 +
  "nb_witnesses_mentioned"
 +
  "nb_witnesses_other"
 +
  "nb_witnesses_religiousofficer"
 +
  "nb_witnesses_witness"
 +
  "nbr"
 +
  "nbr_a"
 +
  "nbr_a_l"
 +
  "ncol", dagDisplay.ml
 +
  "next_item"
 +
  "next_pevent", updateInd.ml
 +
  "next_sibling", dagDisplay.ml
 +
  "nn"
 +
  "nob_title"
 +
  "nobility_title"
 +
  "not"
 +
  "not_dead", updateInd.ml
 +
  "note", history.ml
 +
  "notes", historyDiffDisplay.ml, updateInd.ml
 +
  "nth"
 +
  "nth_c"
 +
  "number_of_ancestors"
 +
  "number_of_ancestors_at_level"
 +
  "number_of_bases"
 +
  "number_of_descendants"
 +
  "number_of_descendants_at_level"
 +
  "number_of_subitems"
 +
  "occ", history.ml, historyDiffDisplay.ml,
 +
      updateFam.ml, updateInd.ml
 +
  "occupation", historyDiffDisplay.ml, updateFam.ml,
 +
      updateInd.ml
 +
  "octal"
 +
  "of_course_dead", updateInd.ml
 +
  "on_baptism_date"
 +
  "on_birth_date"
 +
  "on_burial_date"
 +
  "on_cremation_date"
 +
  "on_date"
 +
  "on_death_date"
 +
  "on_marriage_date"
 +
  "or"
 +
  "orday", update_util.ml
 +
  "origin_file", historyDiffDisplay.ml, updateFam.ml
 +
  "ormonth", update_util.ml
 +
  "oryear", update_util.ml
 +
  "other", updateDataDisplay.ml
 +
  "p", updateDataDisplay.ml
 +
  "p_of_index"
 +
  "parent", updateFam.ml
 +
  "part", history.ml
 +
  "path"
 +
  "path_at_level"
 +
  "path_end"
 +
  "person", history.ml, historyDiffDisplay.ml
 +
  "person_index"
 +
  "pevent", historyDiffDisplay.ml, updateInd.ml
 +
  "pevent_date", historyDiffDisplay.ml
 +
  "pevent_name", historyDiffDisplay.ml
 +
  "pevent_note", historyDiffDisplay.ml
 +
  "pevent_place", historyDiffDisplay.ml
 +
  "pevent_src", historyDiffDisplay.ml
 +
  "pevent_witness", historyDiffDisplay.ml
 +
  "place"
 +
  "place_key"
 +
  "places"
 +
  "plugin"
 +
  "plugins"
 +
  "pos", history.ml
 +
  "prec", update_util.ml
 +
  "prec_about", update_util.ml
 +
  "prec_after", update_util.ml
 +
  "prec_before", update_util.ml
 +
  "prec_maybe", update_util.ml
 +
  "prec_no", update_util.ml
 +
  "prec_oryear", update_util.ml
 +
  "prec_sure", update_util.ml
 +
  "prec_yearint", update_util.ml
 +
  "prefix"
 +
  "prefix_base"
 +
  "prefix_base_password"
 +
  "prefix_no_all"
 +
  "prefix_no_iz"
 +
  "prefix_no_lang"
 +
  "prefix_no_pmod"
 +
  "prefix_no_templ"
 +
  "prefix_no_wide"
 +
  "prefix_set"
 +
  "prev_fam_father"
 +
  "prev_fam_index"
 +
  "prev_fam_mother"
 +
  "prev_family"
 +
  "prev_item"
 +
  "prev_sibling", dagDisplay.ml
 +
  "printable", updateDataDisplay.ml
 +
  "psources", historyDiffDisplay.ml
 +
  "public_name", historyDiffDisplay.ml, updateInd.ml
 +
  "pvar"
 +
  "qualifier", updateInd.ml
 +
  "qualifiers", historyDiffDisplay.ml
 +
  "qvar"
 +
  "r_father", updateInd.ml
 +
  "r_mother", updateInd.ml
 +
  "random", srcfileDisplay.ml
 +
  "real_nb_persons", srcfileDisplay.ml
 +
  "red_of_hsv"
 +
  "referer"
 +
  "region", util.ml
 +
  "related"
 +
  "related_type"
 +
  "relation", updateInd.ml
 +
  "relation_her"
 +
  "relation_him"
 +
  "relation_type"
 +
  "relations", historyDiffDisplay.ml
 +
  "reset_count", history.ml, updateDataDisplay.ml
 +
  "reset_count1"
 +
  "reset_count2"
 +
  "reset_count3"
 +
  "reset_desc_level"
 +
  "right"
 +
  "roman", templDate.ml
 +
  "rt_adoption", updateInd.ml
 +
  "rt_candidate_parent", updateInd.ml
 +
  "rt_empty", updateInd.ml
 +
  "rt_foster_parent", updateInd.ml
 +
  "rt_godparent", updateInd.ml
 +
  "rt_recognition", updateInd.ml
 +
  "safe", updateDataDisplay.ml
 +
  "same"
 +
  "seconds"
 +
  "self"
 +
  "sep1000", templDate.ml
 +
  "sep_date_s"
 +
  "set_count"
 +
  "set_infinite_desc_level"
 +
  "set_var", dagDisplay.ml
 +
  "setup_link"
 +
  "sex", historyDiffDisplay.ml, updateFam.ml,
 +
      updateInd.ml
 +
  "slash_approx_birth_date"
 +
  "slash_approx_death_date"
 +
  "slash_baptism_date"
 +
  "slash_birth_date"
 +
  "slash_burial_date"
 +
  "slash_cremation_date"
 +
  "slash_death_date"
 +
  "slash_divorce_date"
 +
  "slash_marriage_date"
 +
  "sorted_list_item"
 +
  "sorted_listb_item"
 +
  "sorted_listc_item"
 +
  "sorted_listd_item"
 +
  "sorted_liste_item"
 +
  "sosa"
 +
  "sosa_access"
 +
  "sosa_anc"
 +
  "sosa_anc_p"
 +
  "sosa_in_list"
 +
  "sosa_link"
 +
  "sosa_next"
 +
  "sosa_prev"
 +
  "sosa_ref", srcfileDisplay.ml
 +
  "sosa_ref_max_anc_level"
 +
  "source"
 +
  "source_type"
 +
  "sources", updateInd.ml
 +
  "sp"
 +
  "spouse", historyDiffDisplay.ml
 +
  "src"
 +
  "start_date", srcfileDisplay.ml
 +
  "static_max_anc_level", dagDisplay.ml
 +
  "static_max_desc_level", dagDisplay.ml
 +
  "static_path"
 +
  "subs", updateDataDisplay.ml
 +
  "substr", updateDataDisplay.ml
 +
  "substr_start"
 +
  "substr_start_e"
 +
  "suburb", updateDataDisplay.ml
 +
  "suffix"
 +
  "supervisor"
 +
  "surname", history.ml, historyDiffDisplay.ml,
 +
      updateFam.ml, updateInd.ml
 +
  "surname_alias", updateInd.ml
 +
  "surname_begin"
 +
  "surname_end"
 +
  "surname_key"
 +
  "surname_key_strip"
 +
  "surname_key_val"
 +
  "surnames_aliases", historyDiffDisplay.ml
 +
  "svar"
 +
  "t_estate", updateInd.ml
 +
  "t_ident", updateInd.ml
 +
  "t_main", updateInd.ml
 +
  "t_name", updateInd.ml
 +
  "t_nth", updateInd.ml
 +
  "table", srcfileDisplay.ml
 +
  "tail", updateDataDisplay.ml
 +
  "text", dagDisplay.ml, update_util.ml
 +
  "time", history.ml
 +
  "title", history.ml, updateDataDisplay.ml,
 +
      updateInd.ml
 +
  "title_date_end", updateInd.ml
 +
  "title_date_start", updateInd.ml
 +
  "titles", historyDiffDisplay.ml
 +
  "today", hutil.ml
 +
  "town", util.ml
 +
  "township", util.ml
 +
  "transl_date", historyDiffDisplay.ml
 +
  "true"
 +
  "type"
 +
  "update", history.ml
 +
  "url"
 +
  "url_no_pwd"
 +
  "url_set"
 +
  "url_set2"
 +
  "url_set3"
 +
  "url_set_pn"
 +
  "user", history.ml
 +
  "v", history.ml
 +
  "val"
 +
  "value", updateDataDisplay.ml
 +
  "var", history.ml
 +
  "version"
 +
  "wcnt", updateFam.ml, updateInd.ml
 +
  "wedding_birthday"
 +
  "week_day", templDate.ml
 +
  "witness", updateFam.ml, updateInd.ml
 +
  "witness_attending"
 +
  "witness_civilofficer"
 +
  "witness_godparent"
 +
  "witness_informant"
 +
  "witness_kind", updateInd.ml
 +
  "witness_mentioned"
 +
  "witness_other"
 +
  "witness_relation"
 +
  "witness_religiousofficer"
 +
  "witnesses", historyDiffDisplay.ml
 +
  "wizard", historyDiffDisplay.ml
 +
  "wiznotes_dir_exists", srcfileDisplay.ml
 +
  "year", templDate.ml, update_util.ml
 +
  "year2"
 +
  "yymmdd", dateDisplay.ml
 +
  "yyyymmdd", dateDisplay.ml
 
</pre>
 
</pre>
 
</div>
 
</div>
 +
 +
=== Note for has_event (v7) ===
 +
Note that the {{c|has_event}} function does not consider birth, baptism, death and burial as "events" per se (as they are often already listed in the personnal data of the individual). If you want those events to be taken into account in this function, then you have to add {{c|1=has_events=always}} in your {{c|.gwf}} parameter file.
 +
 +
Note also that if {{c|1=has_events=never}}, then {{c|has_event}} always returns {{c|False}}.
 +
 +
== JavaScript ==
 +
 +
JavaScript can be inserted anytime within templates. JavaScript code may contain template commands as in:
 +
<pre>
 +
<script type="text/javascript">
 +
  <!--
 +
  function over1(xx)
 +
  {
 +
  document.getElementById(xx).style.%if;(evarso="on")outline="#C0FEFF solid 6px"%else;backgroundColor="#CBFECE"%end;;
 +
  return false;
 +
  }
 +
  function out1(xx)
 +
  {
 +
  document.getElementById(xx).style.%if;(evarso="on")outline="none"%else;backgroundColor=""%end;;
 +
  return false;
 +
  }
 +
  -->
 +
</script>
 +
</pre>
 +
 +
Note that GeneWeb does not perform any language interpretation ([text to be translated]) within HTML comments!
 +
<!--(other WiKiText commands to be verified)-->
  
 
== Macros (%x) ==
 
== Macros (%x) ==
  
See [[Macros]] for a description of their use.
+
See [[Macros]] for a description of their use and a better/updated table.
  
 
Below is the result of calling all 26 lower case possible macros:
 
Below is the result of calling all 26 lower case possible macros:
Line 336: Line 878:
  
 
List of the commands appearing in URL with the form:
 
List of the commands appearing in URL with the form:
  %sm=COMMAND;p=param1;n=param2;
+
  %prefix;m=COMMAND;p=param1;n=param2; (or %sm=COMMAND... in notes and m=SRC .txt files)
 +
 
 +
This list does not claim to be exhaustive, and does not "explain" what each command does!
  
 
<div style="column-count:4;-moz-column-count:4;-webkit-column-count:4">
 
<div style="column-count:4;-moz-column-count:4;-webkit-column-count:4">
"A"
+
  "A"
"ADD_FAM"  
+
  "AD"
"ADD_FAM_OK"  
+
  "ADD_FAM"
"ADD_IND"  
+
  "ADD_FAM_OK"
"ADD_IND_OK"
+
  "ADD_IND"
"ADD_PAR"  
+
  "ADD_IND_OK"
"ANM"  
+
  "ADD_PAR"
"AN"
+
  "ADD_PAR_OK"
"AD"
+
  "AM"
"AM"
+
  "AN"
"AS_OK"  
+
  "ANM"
"B"  
+
  "AS_OK"
"C"
+
  "C"
"CAL"  
+
  "CAL"
"CHG_CHN"  
+
  "CAST"
"CHG_CHN_OK"  
+
  "CHANGE_WIZ_VIS"
"CHG_FAM_ORD"  
+
  "CHG_CHN"
"CHG_FAM_ORD_OK"  
+
  "CHG_CHN_OK"
"CONN_WIZ"  
+
  "CHG_EVT_FAM_ORD"
"D"
+
  "CHG_EVT_FAM_ORD_OK"
"DAG"  
+
  "CHG_EVT_IND_ORD"
"DEL_FAM"
+
  "CHG_EVT_IND_ORD_OK"
"DEL_FAM_OK"
+
  "CHG_FAM_ORD"
"DEL_IMAGE"
+
  "CHG_FAM_ORD_OK"
"DEL_IMAGE_OK"  
+
  "CONN_WIZ"
"DEL_IND"
+
  "D"
"DEL_IND_OK"  
+
  "DAG" *
"DOC" (* obsolete *)
+
  "DATE"
"FORUM"
+
  "DEL_FAM"
"FORUM_ADD"
+
  "DEL_FAM_OK"
"FORUM_ADD_OK"
+
  "DEL_IMAGE"
"FORUM_DEL"
+
  "DEL_IMAGE_OK"
"FORUM_P_P"
+
  "DEL_IND"
"FORUM_SEARCH"
+
  "DEL_IND_OK"
"FORUM_VAL"
+
  "F"
"FORUM_VIEW"
+
  "FIXBASE"
"H"
+
  "FIXBASE_OK"
"HIST"  
+
  "FORUM_ADD"
"HIST_CLEAN"
+
  "FORUM_ADD_OK"
"HIST_CLEAN_OK"  
+
  "FORUM_DEL"
"HIST_DIFF"  
+
  "FORUM_P_P"
"HIST_SEARCH"  
+
  "FORUM_SEARCH"
"IMH"  
+
  "FORUM_VAL"
"INV_FAM"
+
  "FORUM_VIEW"
"INV_FAM_OK"
+
  "H"
"KILL_ANC"  
+
  "HIST"
"LB"  
+
  "HIST_CLEAN"
"LD"  
+
  "HIST_CLEAN_OK"
"LINKED"
+
  "HIST_DIFF"
"LL"  
+
  "HIST_SEARCH"
"LM"  
+
  "IM" *
"LEX"  
+
  "IMH" *
"MISC_NOTES"  
+
  "INV_FAM"
"MISC_NOTES_SEARCH"  
+
  "INV_FAM_OK"
"MOD_DATA"
+
  "KILL_ANC"
"MOD_DATA_OK"
+
  "L"
"MOD_FAM"
+
  "LB"
"MOD_FAM_OK"
+
  "LD"
"MOD_IND"
+
  "LINKED"
"MOD_IND_OK"  
+
  "LL"
"MOD_NOTES"
+
  "LM"
"MOD_NOTES_OK"
+
  "LOG"
"MOD_WDOC"  (* obsolete *)
+
  "MISC_NOTES"
"MOD_WDOC_OK"  (* obsolete *)
+
  "MISC_NOTES_SEARCH"
"MOD_WIZNOTES"  
+
  "MOD_DATA"
"MOD_WIZNOTES_OK"
+
  "MOD_DATA_OK"
"MRG"  
+
  "MOD_FAM"
"MRG_DUP"
+
  "MOD_FAM_OK"
"MRG_DUP_IND_Y_N"  
+
  "MOD_IND"
"MRG_DUP_FAM_Y_N"  
+
  "MOD_IND_OK"
"MRG_FAM"
+
  "MOD_NOTES"
"MRG_FAM_OK"
+
  "MOD_NOTES_OK"
"MRG_MOD_FAM_OK"  
+
  "MOD_WIZNOTES"
"MRG_IND"
+
  "MOD_WIZNOTES_OK"
"MRG_IND_OK"
+
  "MRG"
"MRG_MOD_IND_OK"  
+
  "MRG_DUP"
"N"
+
  "MRG_DUP_FAM_Y_N"
"NG"
+
  "MRG_DUP_IND_Y_N"
"NOTES"  
+
  "MRG_FAM"
"OA"  
+
  "MRG_FAM_OK"
"OE"  
+
  "MRG_IND"
"P"
+
  "MRG_IND_OK"
"POP_PYR"  
+
  "MRG_MOD_FAM_OK"
"PS" P
+
  "MRG_MOD_IND_OK"
"R"
+
  "N"
"REQUEST"  
+
  "NAME"
"RL"  
+
  "NG"
"RLM"  
+
  "NOTES"
"S"  
+
  "OA"
"SND_IMAGE"
+
  "OE"
"SND_IMAGE_OK"  
+
  "OPT"
"SRC"
+
  "P"
"STAT" B
+
  "POP_PYR"
"CHANGE_WIZ_VIS"  
+
  "PPS"
"TT"  
+
  "PS"
"U"  
+
  "R"
"VIEW_WIZNOTES"  
+
  "REQUEST"
"WDOC" (* obsolete *)
+
  "RL"
"WIZNOTES"  
+
  "RLM" *
"WIZNOTES_SEARCH"  
+
  "S"
 +
  "SND_IMAGE"
 +
  "SND_IMAGE_OK"
 +
  "SRC" *
 +
  "STAT"
 +
  "TP"
 +
  "TT"
 +
  "U"
 +
  "VIEW_WIZNOTES" *
 +
  "WIZNOTES" *
 +
  "WIZNOTES_SEARCH" *
 
</div>
 
</div>
 +
 +
Commands marked with a * are documented below:
 +
*[[image|IM]] and [[image|IMH]]
 +
*[[trees|RLM]] and [[trees|DAG]]
 +
*[[image|SRC]]
 +
*[[wiznotes|WIZNOTES]] and the various WIZ related commands.
  
 
== Variables (evar and bvar) ==
 
== Variables (evar and bvar) ==
 +
 +
GeneWeb proposed a general purpose mechanism allowing the user/programmer to extend at will the notion of variable described here.
 +
=== '''bvar''' ===
 +
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;
 +
=== '''evar''' ===
 +
Similarly, if we have added a new variable in the URL of the query to GeneWeb ({{c|1=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>
 +
 +
A way to build the list of those variables is to search for {{c|evar.xxx}} and/or {{c|e.xxx}} in template files.<br/>
 +
There are potentially few variables used in {{c|.ml}} code, that are parts of {{c|conf.env}} to be searched with {{c|p_getenv}}
 +
 +
Some examples of '''evar''' usage in [[gwd#Some_frequently_used_evars]]
 +
 +
=== '''var''' ===
 +
The special variable ''var'' is treated in the following fashion within notes, sources and comments:
 +
If you define in the {{c|.gwf}} file a variable {{c|1=var_text=some_text}}, then invoquing the macro {{c|%vtext;}} in a note or a template will produce the text {{c|some_text}} as in the following example:
 +
var_who=Bond, James Bond
 +
{{c|"My name is %vwho;."}} in a note will be transformed into {{c|"My name is Bond, James Bond."}}.
 +
 +
This feature is used by some to facilitate signature of sources. The {{c|.gwf}} file contains a list of {{c|var_nickname}} definitions whose value is a full name and possibly a pointer to a page containing more detailed information:
 +
var_henri=<a href="http://site/base?p=Firstname;n=lastname">First_name Lastname</a>
 +
(no %x or %macro; in the value of the parameter!!).
 +
 +
Note: in latest version 7 of GeneWeb, the wiki syntax can be used in the parameter as in:
 +
var_who=<nowiki>[[james/bond/James Bond]]</nowiki>
 +
which will include the text "James Bond" and a link to the corresponding page.
 +
 +
== Bvar variables used in templates ==
 +
 +
<div style="column-count:4;-moz-column-count:4;-webkit-column-count:4">
 +
  access_by_key
 +
  always_surname
 +
  auth_file
 +
  authorized_wizards_notes
 +
  base_notes_title
 +
  birth_symbol
 +
  can_kill_ancestors
 +
  can_send_image
 +
  carrousel
 +
  com
 +
  counter
 +
  css
 +
  css_prop
 +
  datalist_fn
 +
  datalist_occu
 +
  datalist_place
 +
  datalist_sn
 +
  datalist_src
 +
  datalist_z
 +
  death_symbol
 +
  default_fnav_images
 +
  default_fnav_semi
 +
  default_fnav_spouse
 +
  default_image
 +
  default_image_no
 +
  default_lang
 +
  default_sosa_ref
 +
  defaut_lang
 +
  disable_forum
 +
  display_sosa
 +
  display_timeline
 +
  event_age
 +
  fn_sn_switch
 +
  friend_passwd
 +
  friend_passwd_file
 +
  full_siblings
 +
  hide_advanced_request
 +
  history
 +
  history_diff
 +
  jquery
 +
  latest_event
 +
  max_anc_level
 +
  max_anc_tree
 +
  max_cousins_level
 +
  max_dates
 +
  max_desc_level
 +
  max_desc_tree
 +
  max_rlm_nbr
 +
  maxlev
 +
  menu
 +
  misc
 +
  module_perso_ix
 +
  module_perso_tplnb
 +
  motd
 +
  move_comment
 +
  moved
 +
  multi_parents
 +
  no_image_for_visitor
 +
  no_note_for_visitor
 +
  notextarea
 +
  origin_file
 +
  p_mod
 +
  particles
 +
  perso_module_modnum
 +
  perso_module_tplnum
 +
  plugins
 +
  propose_add_family
 +
  propose_alias
 +
  propose_place_surnames
 +
  propose_qualifier
 +
  propose_titles
 +
  setup_http
 +
  setup_link
 +
  show_consang
 +
  show_flag
 +
  show_invisible
 +
  static_path
 +
  template
 +
  timeline
 +
  tuxfamily
 +
  txt
 +
  uppercase
 +
  use_cdn
 +
  var_img_ext
 +
  var_t_BIRTHA
 +
  var_t_DEATHA
 +
  var_t_MARRIAGEA
 +
  visitor_access
 +
  visitor_access_msg_en
 +
  visitor_access_msg_lg
 +
  welcome_logo
 +
  welcome_logo_style
 +
  wide
 +
  wizard_descr_file
 +
  wizard_just_friend
 +
  wizard_passwd
 +
  wizard_passwd_file
 +
</div>
 +
 +
== Bvar variables used by Gwd ==
 +
 +
<div style="column-count:4;-moz-column-count:4;-webkit-column-count:4">
 +
always_surname, yes
 +
auth_file
 +
base_notes_title
 +
body_prop
 +
can_kill_ancestors
 +
can_send_image, no
 +
conf.base_env
 +
counter, no
 +
death_symbol, †
 +
default_sosa_ref
 +
disable_forum, yes
 +
dump_bad_images, yes
 +
expand_env
 +
fast_alphabetic, yes
 +
forum_exclude_file
 +
friend_passwd
 +
friend_passwd_file
 +
has_events
 +
history, yes
 +
history_diff
 +
history_path
 +
image_prefix
 +
images_path
 +
latest_event
 +
long_date, yes
 +
max_anc_tree
 +
max_ancestor_implex
 +
max_cousins
 +
max_desc_level
 +
max_desc_tree
 +
max_images_size
 +
max_nb_update
 +
max_rlm_nbr
 +
moderator_file
 +
no
 +
notes_alias_file
 +
notify_change
 +
passwd_
 +
place
 +
place_surname_link_to_ind, yes
 +
places_inverted, yes
 +
print_advanced_title, yes
 +
propose_add_family, no
 +
ptempl, yes
 +
red_if_not_exist
 +
short_place_threshold
 +
show_query_time
 +
static_path
 +
template
 +
var_
 +
visitor_access, no
 +
wizard_descr_file
 +
wizard_passwd_file
 +
</div>
 +
 +
The bvar name is sometimes followed by one of its options (yes/no)
 +
 +
== Building trees through direct url construction ==
 +
 +
See [[trees]] or [[trees/fr]]
 +
 +
{{manual}}
 +
 +
[[Category:Manual]]

Latest revision as of 18:58, 1 June 2023

150px-Geographylogo svg.png Language: English

Template programming (%if; ... %end;)

The template mechanism provides a very powerful mechanism to construct HTML (or other) pages according to the content of a GeneWeb base. This section is not intending to give an exhaustive description of the corresponding language. Through some examples extracted from gw/etc/perso.txt, it provides a glimpse of the possibility. The last two examples are extracted from a template that generates LaTeX rather than HTML.

For further analysis, explore the various other template files, and on last resort, explore the Ocaml source files!!

WARNING: one of the main issue with template programming is that all functions are not permanently available on all pages! Describing which are available where is beyond reach, and trial and error is the only solution, but being aware of the problem is important!!

Programming constructs:

 %define(p1, p2) ... %end;
 %if;(cond) [%elseif;] [%else;] %end;
 %let;xxx;zzz%in;
 %foreach; ... %end;
 %for;i;0;n;... %end;
 %apply;xxxx(p1, p2) or
 %apply; ... [%with;... [%and;] ...%end;]
 %nl; %nn; %sp; %sq;

Functions callable with %apply:

 a_of_b ("aaa", "bbb") 
 a_of_b2 ("aaa", "bbb", "ccc") test vowel at beginning of "ccc"
 a_of_b_gr_eq_lev (??)
 capitalize ("aaa")
 language_name ("fr")
 nth("aaa"/"bbb"/"ccc"/"ddd", n)
 nth_c("abcdef", n)
 blue_of_hsv
 red_of_hsv
 green_of_hsv

Arithmetic and booleans:

 +, -, /, *, %, =, !=, <, <=, >, >=, "and", "or", "not", "is_substr" or "in"

WARNING: all functions may not be fully available depending on the execution context!

 <title>%nn;
   %if;has_public_name;
     %if;has_qualifiers;%public_name; %qualifier;
     %else;%public_name; %surname;%end;
   %else;
     %if;has_qualifiers;%first_name; %qualifier;
     %else;%first_name; %surname;%end;
   %end;
 </title>
%define;married_to(sexx, date_place)
 %if;(sexx = 0 or sexx = 2)
   %if;are_married;[*married%t to:::date_place]0%nn;
   %elseif;are_not_married;[*relationship%t to:::date_place]0%nn;
   %elseif;are_engaged;[*engaged%t to:::date_place]0%nn;
   %elseif;is_no_sexes_check;[*relationship%t to:::date_place]0%nn;
   %elseif;is_no_mention;date_place [*with]%nn;
   %end;
 %else;
   %if;are_married;[*married%t to:::date_place]1%nn;
   %elseif;are_not_married;[*relationship%t to:::date_place]1%nn;
   %elseif;are_engaged;[*engaged%t to:::date_place]1%nn;
   %elseif;is_no_sexes_check;[*relationship%t to:::date_place]1%nn;
   %elseif;is_no_mention;date_place [*with]%nn;
   %end;
 %end;
%end;
%if;(bvar.can_send_image != "no" and image = "" and first_name != "?" and surname != "?")
     <li><a href="%prefix;m=SND_IMAGE;i=%index;" class="add_portrait">
            %if;(auto_image_file_name != "")[*modify picture]%else;[*add picture]%end;
          </a>
     </li>
%end;
 
%define;hgindex(alxx, snxx, fnxx, occxx)
  %if;(alxx = "0")
    %if;(occxx = "0")
      \index{snxx, fnxx}
    %else;
      \index{snxx, fnxx (occxx)}
    %end;
  %else;
    %if;(occxx = "0")
      \index{alxx, voir snxx, fnxx}
    %else;
      \index{alxx, voir snxx, fnxx (occxx)}
    %end;
  %end;
%end
%foreach;alias;
    {\it {\bf %alias;}}%apply;hgindex(alias, surname, first_name, occ)\\%nl;
%end;

List of commands

This list does not claim to be exhaustive (but pretty close!!). A good way to understand the semantic of these commands is to explore the template files and observe how they are used (grep is your friend).

Most of the commands are interpreted by the files perso.ml or templ.ml. When this is not the case, the name of the interpreter file is associated with the command.

  "a_of_b"
  "a_of_b2"
  "a_of_b_gr_eq_lev"
  "acc_if_titles", updateInd.ml
  "acc_private", updateInd.ml
  "acc_public", updateInd.ml
  "acces", historyDiffDisplay.ml
  "access", dagDisplay.ml, history.ml,
      historyDiffDisplay.ml
  "access_by_key"
  "action"
  "add_in_sorted_list"
  "add_in_sorted_listb"
  "add_in_sorted_listc"
  "add_in_sorted_listd"
  "add_in_sorted_liste"
  "after", historyDiffDisplay.ml
  "age"
  "alias", updateInd.ml
  "aliases", historyDiffDisplay.ml
  "align", dagDisplay.ml
  "all"
  "anc1"
  "anc2"
  "anc_f_list"
  "anc_level"
  "anc_paths"
  "anc_paths_at_level"
  "anc_paths_at_level_cnt"
  "anc_paths_at_level_cnt_raw"
  "anc_paths_cnt"
  "anc_paths_cnt_raw"
  "anc_sosa"
  "ancestor"
  "ancestor_at_level"
  "ancestor_level"
  "ancestor_surname"
  "ancestor_tree_line"
  "and"
  "approx_birth_place"
  "approx_death_place"
  "are_divorced"
  "are_engaged"
  "are_marriage_banns"
  "are_marriage_contract"
  "are_marriage_license"
  "are_married"
  "are_not_married"
  "are_pacs"
  "are_residence"
  "are_separated"
  "auto_image_file_name"
  "bapt", updateInd.ml
  "bapt_note", updateInd.ml
  "bapt_place", updateInd.ml
  "bapt_src", updateInd.ml
  "baptism", historyDiffDisplay.ml
  "baptism_date"
  "baptism_note", historyDiffDisplay.ml
  "baptism_place", historyDiffDisplay.ml
  "baptism_source"
  "baptism_src", historyDiffDisplay.ml
  "baptism_witness"
  "bar_link", dagDisplay.ml
  "base", srcfileDisplay.ml
  "base_header"
  "base_trailer"
  "bases_list"
  "bdo", dagDisplay.ml
  "before", historyDiffDisplay.ml
  "birth", historyDiffDisplay.ml, updateInd.ml
  "birth_date"
  "birth_day", updateFam.ml
  "birth_month", updateFam.ml
  "birth_note", historyDiffDisplay.ml, updateInd.ml
  "birth_place", historyDiffDisplay.ml, 
      updateFam.ml, updateInd.ml
  "birth_source"
  "birth_src", historyDiffDisplay.ml, updateInd.ml
  "birth_witness"
  "birth_year", updateFam.ml
  "birthday"
  "blue_of_hsv"
  "bname_prefix"
  "body_prop"
  "border"
  "browsing_with_sosa_ref", dagDisplay.ml,
      srcfileDisplay.ml
  "bt_buried", updateInd.ml
  "bt_cremated", updateInd.ml
  "bt_unknown_burial", updateInd.ml
  "burial", historyDiffDisplay.ml, updateInd.ml
  "burial_date"
  "burial_note", historyDiffDisplay.ml, updateInd.ml
  "burial_place", historyDiffDisplay.ml, updateInd.ml
  "burial_source"
  "burial_src", historyDiffDisplay.ml, updateInd.ml
  "burial_witness"
  "bvar", updateFam.ml
  "cal_french", update_util.ml
  "cal_gregorian", update_util.ml
  "cal_hebrew", update_util.ml
  "cal_julian", update_util.ml
  "calendar", update_util.ml
  "cancel_links"
  "canton", util.ml
  "capitalize"
  "cell"
  "cell_nbr", dagDisplay.ml
  "center", dagDisplay.ml
  "cgi"
  "charset"
  "child", updateFam.ml
  "child_cnt"
  "child_name"
  "children", historyDiffDisplay.ml
  "clean_comment_tags"
  "clean_html_tags"
  "cnt", updateDataDisplay.ml, updateFam.ml, updateInd.ml
  "colspan", dagDisplay.ml
  "comment", historyDiffDisplay.ml, updateFam.ml
  "computable_age"
  "computable_death_age"
  "computable_marriage_age"
  "connections"
  "consanguinity"
  "copyright"
  "count", history.ml, updateDataDisplay.ml
  "count1"
  "count2"
  "count3"
  "country", util.ml
  "county", util.ml
  "cous_paths"
  "cous_paths_cnt"
  "cous_paths_cnt_raw"
  "cous_paths_max_date"
  "cous_paths_min_date"
  "cousin"
  "cousin_level"
  "cousins"
  "cousins_cnt"
  "create", updateFam.ml, updateInd.ml, updateIndOk.ml,
      update_util.ml
  "cremated_date"
  "cremation_place"
  "cremation_witness"
  "dag", dagDisplay.ml
  "dag_cell", dagDisplay.ml
  "dag_cell_pre", dagDisplay.ml
  "dag_line", dagDisplay.ml
  "dag_line_pre", dagDisplay.ml
  "date", historyDiffDisplay.ml, hutil.ml
  "date_begin"
  "date_end"
  "date_s"
  "dates", history.ml
  "day", templDate.ml, update_util.ml
  "day2"
  "ddmmyyyy", dateDisplay.ml
  "dead_dont_know_when", updateInd.ml
  "death", historyDiffDisplay.ml, updateInd.ml
  "death_age"
  "death_date"
  "death_day", updateFam.ml
  "death_month", updateFam.ml
  "death_note", historyDiffDisplay.ml, updateInd.ml
  "death_place", historyDiffDisplay.ml, updateFam.ml,
      updateInd.ml
  "death_source"
  "death_src", historyDiffDisplay.ml, updateInd.ml
  "death_witness"
  "death_year", updateFam.ml
  "debug"
  "desc_cnt"
  "desc_level"
  "desc_paths"
  "desc_paths_at_level"
  "desc_paths_at_level_cnt"
  "desc_paths_at_level_cnt_raw"
  "desc_paths_cnt"
  "desc_paths_cnt_raw"
  "descendant"
  "descendant_cnt"
  "descendant_level"
  "died"
  "died_young", updateInd.ml
  "digest", updateFam.ml, updateInd.ml
  "district", util.ml
  "divorce", historyDiffDisplay.ml, updateFam.ml
  "divorce_date"
  "dmyyyy", dateDisplay.ml
  "doctype"
  "dont_know_if_dead", updateInd.ml
  "dr_disappeared", updateInd.ml
  "dr_executed", updateInd.ml
  "dr_killed", updateInd.ml
  "dr_murdered", updateInd.ml
  "dr_unspecified", updateInd.ml
  "e_name", updateFam.ml, updateInd.ml
  "e_note", updateFam.ml, updateInd.ml
  "e_place", updateFam.ml, updateInd.ml
  "e_src", updateFam.ml, updateInd.ml
  "empty_sorted_list"
  "empty_sorted_listb"
  "empty_sorted_listc"
  "empty_sorted_listd"
  "empty_sorted_liste"
  "enclosing"
  "encode", updateDataDisplay.ml
  "entry", updateDataDisplay.ml
  "entry_ini", updateDataDisplay.ml
  "entry_key", updateDataDisplay.ml
  "entry_value", updateDataDisplay.ml
  "entry_value_rev", updateDataDisplay.ml
  "env"
  "env_binding"
  "evar", historyDiffDisplay.ml, updateDataDisplay.ml
  "evar_cur"
  "event", updateFam.ml, updateInd.ml
  "event_date", updateFam.ml, updateInd.ml
  "event_str", updateFam.ml, updateInd.ml
  "event_witness"
  "event_witness_kind"
  "event_witness_relation"
  "event_witness_relation_kind"
  "f_of_index"
  "false"
  "family", historyDiffDisplay.ml
  "family_cnt"
  "father", dagDisplay.ml, updateFam.ml
  "father_age_at_birth"
  "father_sosa"
  "fevent", historyDiffDisplay.ml, updateFam.ml
  "fevent_date", historyDiffDisplay.ml
  "fevent_name", historyDiffDisplay.ml
  "fevent_note", historyDiffDisplay.ml
  "fevent_place", historyDiffDisplay.ml
  "fevent_src", historyDiffDisplay.ml
  "fevent_witness", historyDiffDisplay.ml
  "first", updateDataDisplay.ml
  "first_name", history.ml, historyDiffDisplay.ml, 
      updateFam.ml, updateInd.ml
  "first_name_alias", updateInd.ml
  "first_name_key"
  "first_name_key_strip"
  "first_name_key_val"
  "first_names_aliases", historyDiffDisplay.ml
  "found", history.ml
  "french", templDate.ml
  "friend"
  "fsources", historyDiffDisplay.ml, updateFam.ml
  "fwitness", updateFam.ml
  "fwitness_kind", updateFam.ml
  "get_var", dagDisplay.ml
  "green_of_hsv"
  "gregorian", templDate.ml
  "has_aliases", updateInd.ml
  "has_approx_birth_date"
  "has_approx_birth_place"
  "has_approx_death_date"
  "has_approx_death_place"
  "has_baptism_date"
  "has_baptism_note"
  "has_baptism_place"
  "has_baptism_source"
  "has_baptism_witnesses"
  "has_birth_date", updateInd.ml
  "has_birth_note"
  "has_birth_place"
  "has_birth_source"
  "has_birth_witnesses"
  "has_burial_date"
  "has_burial_note"
  "has_burial_place"
  "has_burial_source"
  "has_burial_witnesses"
  "has_children"
  "has_comment"
  "has_consanguinity"
  "has_cremation_date"
  "has_cremation_place"
  "has_cremation_witnesses"
  "has_date"
  "has_death_date"
  "has_death_note"
  "has_death_place"
  "has_death_source"
  "has_death_witnesses"
  "has_event"
  "has_families"
  "has_fevents", updateFam.ml
  "has_first_names_aliases", updateInd.ml
  "has_fsources"
  "has_fwitness", updateFam.ml
  "has_history", history.ml, srcfileDisplay.ml
  "has_image"
  "has_image_url"
  "has_linked_page"
  "has_linked_pages"
  "has_marriage_note"
  "has_marriage_source"
  "has_misc_notes", srcfileDisplay.ml
  "has_nephews_or_nieces"
  "has_next_sibling", dagDisplay.ml
  "has_nobility_titles"
  "has_note"
  "has_notes", srcfileDisplay.ml
  "has_occupation"
  "has_parents"
  "has_pevent_baptism", updateInd.ml
  "has_pevent_birth", updateInd.ml
  "has_pevent_burial", updateInd.ml
  "has_pevent_cremation", updateInd.ml
  "has_pevent_death", updateInd.ml
  "has_pevents", updateInd.ml
  "has_place"
  "has_possible_duplications"
  "has_prev_sibling", dagDisplay.ml
  "has_primary_pevents", updateInd.ml
  "has_psources"
  "has_public_name"
  "has_qualifiers", updateInd.ml
  "has_referer"
  "has_relation_her"
  "has_relation_him"
  "has_relations", updateInd.ml
  "has_secondary_pevents", updateInd.ml
  "has_siblings"
  "has_sosa"
  "has_sources"
  "has_spouse"
  "has_src"
  "has_surnames_aliases", updateInd.ml
  "has_titles", updateInd.ml
  "has_witness", updateInd.ml
  "has_witnesses"
  "head_title", dagDisplay.ml
  "hebrew", templDate.ml
  "hexa"
  "hidden"
  "highlight"
  "himher", updateFam.ml
  "history_file", history.ml
  "history_len", historyDiffDisplay.ml
  "history_line", history.ml, historyDiffDisplay.ml
  "hour", templDate.ml
  "hours"
  "ident"
  "ident_key"
  "image", historyDiffDisplay.ml, updateInd.ml
  "image_html_url"
  "image_medium_size"
  "image_prefix"
  "image_size"
  "image_small_size"
  "image_url"
  "include"
  "include_perso_header", updateFam.ml, updateInd.ml
  "incr_count", history.ml, updateDataDisplay.ml
  "incr_count1"
  "incr_count2"
  "incr_count3"
  "incr_next_pevent", updateInd.ml
  "index", dagDisplay.ml, templDate.ml, updateInd.ml
  "ini", updateDataDisplay.ml
  "init", srcfileDisplay.ml
  "init_cache"
  "initial", updateDataDisplay.ml
  "integer", hutil.ml
  "integer_range", hutil.ml
  "interp"
  "interval"
  "is_bar", dagDisplay.ml
  "is_buried"
  "is_center"
  "is_certainly_dead"
  "is_cremated"
  "is_dead"
  "is_descendant"
  "is_empty"
  "is_female", updateInd.ml
  "is_first", dagDisplay.ml, updateFam.ml, updateInd.ml
  "is_hr", dagDisplay.ml
  "is_hr_center", dagDisplay.ml
  "is_hr_left", dagDisplay.ml
  "is_hr_right", dagDisplay.ml
  "is_invisible", history.ml
  "is_last", dagDisplay.ml, updateFam.ml, updateInd.ml
  "is_left"
  "is_main"
  "is_male", updateInd.ml
  "is_modified", updateDataDisplay.ml
  "is_no_mention"
  "is_no_sexes_check"
  "is_note", history.ml
  "is_nothing", dagDisplay.ml
  "is_printed_by_template"
  "is_private"
  "is_public"
  "is_restricted"
  "is_right"
  "is_self"
  "is_sibling_after"
  "is_sibling_before"
  "is_substr"
  "is_top"
  "item", dagDisplay.ml
  "iz"
  "julian", templDate.ml
  "julian_day", templDate.ml
  "just_friend_wizard"
  "key", history.ml
  "lang"
  "language_name"
  "lazy_force"
  "lazy_print"
  "lazy_printed"
  "left"
  "length", updateDataDisplay.ml
  "lev_cnt"
  "level"
  "line", historyDiffDisplay.ml
  "line_nbr", dagDisplay.ml
  "link", updateInd.ml
  "link_next", dagDisplay.ml
  "linked_page"
  "list_size"
  "listb_size"
  "listc_size"
  "listd_size"
  "liste_size"
  "lvl"
  "manitou"
  "mark_descendants"
  "marriage", historyDiffDisplay.ml, updateFam.ml
  "marriage_age"
  "marriage_date"
  "marriage_note", updateFam.ml
  "marriage_place", historyDiffDisplay.ml, updateFam.ml
  "marriage_places"
  "marriage_source"
  "marriage_src", historyDiffDisplay.ml, updateFam.ml
  "marriage_type", historyDiffDisplay.ml
  "max", dagDisplay.ml, updateDataDisplay.ml
  "max_a"
  "max_anc_level"
  "max_cous_level"
  "max_d"
  "max_desc_level"
  "max_wid", dagDisplay.ml
  "message_to_wizard"
  "min", dagDisplay.ml
  "min_wid", dagDisplay.ml
  "minute", templDate.ml
  "minutes"
  "misc_names"
  "mmddyyyy", dateDisplay.ml
  "mn", history.ml
  "mode"
  "month", templDate.ml, update_util.ml
  "month2"
  "moon_age", templDate.ml
  "moon_phase", templDate.ml
  "mother", dagDisplay.ml
  "mother_age_at_birth"
  "mother_sosa"
  "mrel", updateFam.ml
  "name", srcfileDisplay.ml
  "nb_accesses", srcfileDisplay.ml
  "nb_accesses_to_welcome", srcfileDisplay.ml
  "nb_children"
  "nb_children_total"
  "nb_events"
  "nb_families", historyDiffDisplay.ml
  "nb_fevents", updateFam.ml
  "nb_ind"
  "nb_persons", srcfileDisplay.ml
  "nb_pevents", updateInd.ml
  "nb_results", updateDataDisplay.ml
  "nb_times"
  "nb_witnesses_attending"
  "nb_witnesses_civilofficer"
  "nb_witnesses_godparent"
  "nb_witnesses_informant"
  "nb_witnesses_mentioned"
  "nb_witnesses_other"
  "nb_witnesses_religiousofficer"
  "nb_witnesses_witness"
  "nbr"
  "nbr_a"
  "nbr_a_l"
  "ncol", dagDisplay.ml
  "next_item"
  "next_pevent", updateInd.ml
  "next_sibling", dagDisplay.ml
  "nn"
  "nob_title"
  "nobility_title"
  "not"
  "not_dead", updateInd.ml
  "note", history.ml
  "notes", historyDiffDisplay.ml, updateInd.ml
  "nth"
  "nth_c"
  "number_of_ancestors"
  "number_of_ancestors_at_level"
  "number_of_bases"
  "number_of_descendants"
  "number_of_descendants_at_level"
  "number_of_subitems"
  "occ", history.ml, historyDiffDisplay.ml, 
      updateFam.ml, updateInd.ml
  "occupation", historyDiffDisplay.ml, updateFam.ml,
      updateInd.ml
  "octal"
  "of_course_dead", updateInd.ml
  "on_baptism_date"
  "on_birth_date"
  "on_burial_date"
  "on_cremation_date"
  "on_date"
  "on_death_date"
  "on_marriage_date"
  "or"
  "orday", update_util.ml
  "origin_file", historyDiffDisplay.ml, updateFam.ml
  "ormonth", update_util.ml
  "oryear", update_util.ml
  "other", updateDataDisplay.ml
  "p", updateDataDisplay.ml
  "p_of_index"
  "parent", updateFam.ml
  "part", history.ml
  "path"
  "path_at_level"
  "path_end"
  "person", history.ml, historyDiffDisplay.ml
  "person_index"
  "pevent", historyDiffDisplay.ml, updateInd.ml
  "pevent_date", historyDiffDisplay.ml
  "pevent_name", historyDiffDisplay.ml
  "pevent_note", historyDiffDisplay.ml
  "pevent_place", historyDiffDisplay.ml
  "pevent_src", historyDiffDisplay.ml
  "pevent_witness", historyDiffDisplay.ml
  "place"
  "place_key"
  "places"
  "plugin"
  "plugins"
  "pos", history.ml
  "prec", update_util.ml
  "prec_about", update_util.ml
  "prec_after", update_util.ml
  "prec_before", update_util.ml
  "prec_maybe", update_util.ml
  "prec_no", update_util.ml
  "prec_oryear", update_util.ml
  "prec_sure", update_util.ml
  "prec_yearint", update_util.ml
  "prefix"
  "prefix_base"
  "prefix_base_password"
  "prefix_no_all"
  "prefix_no_iz"
  "prefix_no_lang"
  "prefix_no_pmod"
  "prefix_no_templ"
  "prefix_no_wide"
  "prefix_set"
  "prev_fam_father"
  "prev_fam_index"
  "prev_fam_mother"
  "prev_family"
  "prev_item"
  "prev_sibling", dagDisplay.ml
  "printable", updateDataDisplay.ml
  "psources", historyDiffDisplay.ml
  "public_name", historyDiffDisplay.ml, updateInd.ml
  "pvar"
  "qualifier", updateInd.ml
  "qualifiers", historyDiffDisplay.ml
  "qvar"
  "r_father", updateInd.ml
  "r_mother", updateInd.ml
  "random", srcfileDisplay.ml
  "real_nb_persons", srcfileDisplay.ml
  "red_of_hsv"
  "referer"
  "region", util.ml
  "related"
  "related_type"
  "relation", updateInd.ml
  "relation_her"
  "relation_him"
  "relation_type"
  "relations", historyDiffDisplay.ml
  "reset_count", history.ml, updateDataDisplay.ml
  "reset_count1"
  "reset_count2"
  "reset_count3"
  "reset_desc_level"
  "right"
  "roman", templDate.ml
  "rt_adoption", updateInd.ml
  "rt_candidate_parent", updateInd.ml
  "rt_empty", updateInd.ml
  "rt_foster_parent", updateInd.ml
  "rt_godparent", updateInd.ml
  "rt_recognition", updateInd.ml
  "safe", updateDataDisplay.ml
  "same"
  "seconds"
  "self"
  "sep1000", templDate.ml
  "sep_date_s"
  "set_count"
  "set_infinite_desc_level"
  "set_var", dagDisplay.ml
  "setup_link"
  "sex", historyDiffDisplay.ml, updateFam.ml,
      updateInd.ml
  "slash_approx_birth_date"
  "slash_approx_death_date"
  "slash_baptism_date"
  "slash_birth_date"
  "slash_burial_date"
  "slash_cremation_date"
  "slash_death_date"
  "slash_divorce_date"
  "slash_marriage_date"
  "sorted_list_item"
  "sorted_listb_item"
  "sorted_listc_item"
  "sorted_listd_item"
  "sorted_liste_item"
  "sosa"
  "sosa_access"
  "sosa_anc"
  "sosa_anc_p"
  "sosa_in_list"
  "sosa_link"
  "sosa_next"
  "sosa_prev"
  "sosa_ref", srcfileDisplay.ml
  "sosa_ref_max_anc_level"
  "source"
  "source_type"
  "sources", updateInd.ml
  "sp"
  "spouse", historyDiffDisplay.ml
  "src"
  "start_date", srcfileDisplay.ml
  "static_max_anc_level", dagDisplay.ml
  "static_max_desc_level", dagDisplay.ml
  "static_path"
  "subs", updateDataDisplay.ml
  "substr", updateDataDisplay.ml
  "substr_start"
  "substr_start_e"
  "suburb", updateDataDisplay.ml
  "suffix"
  "supervisor"
  "surname", history.ml, historyDiffDisplay.ml,
      updateFam.ml, updateInd.ml
  "surname_alias", updateInd.ml
  "surname_begin"
  "surname_end"
  "surname_key"
  "surname_key_strip"
  "surname_key_val"
  "surnames_aliases", historyDiffDisplay.ml
  "svar"
  "t_estate", updateInd.ml
  "t_ident", updateInd.ml
  "t_main", updateInd.ml
  "t_name", updateInd.ml
  "t_nth", updateInd.ml
  "table", srcfileDisplay.ml
  "tail", updateDataDisplay.ml
  "text", dagDisplay.ml, update_util.ml
  "time", history.ml
  "title", history.ml, updateDataDisplay.ml,
      updateInd.ml
  "title_date_end", updateInd.ml
  "title_date_start", updateInd.ml
  "titles", historyDiffDisplay.ml
  "today", hutil.ml
  "town", util.ml
  "township", util.ml
  "transl_date", historyDiffDisplay.ml
  "true"
  "type"
  "update", history.ml
  "url"
  "url_no_pwd"
  "url_set"
  "url_set2"
  "url_set3"
  "url_set_pn"
  "user", history.ml
  "v", history.ml
  "val"
  "value", updateDataDisplay.ml
  "var", history.ml
  "version"
  "wcnt", updateFam.ml, updateInd.ml
  "wedding_birthday"
  "week_day", templDate.ml
  "witness", updateFam.ml, updateInd.ml
  "witness_attending"
  "witness_civilofficer"
  "witness_godparent"
  "witness_informant"
  "witness_kind", updateInd.ml
  "witness_mentioned"
  "witness_other"
  "witness_relation"
  "witness_religiousofficer"
  "witnesses", historyDiffDisplay.ml
  "wizard", historyDiffDisplay.ml
  "wiznotes_dir_exists", srcfileDisplay.ml
  "year", templDate.ml, update_util.ml
  "year2"
  "yymmdd", dateDisplay.ml
  "yyyymmdd", dateDisplay.ml

Note for has_event (v7)

Note that the has_event function does not consider birth, baptism, death and burial as "events" per se (as they are often already listed in the personnal data of the individual). If you want those events to be taken into account in this function, then you have to add has_events=always in your .gwf parameter file.

Note also that if has_events=never, then has_event always returns False.

JavaScript

JavaScript can be inserted anytime within templates. JavaScript code may contain template commands as in:

<script type="text/javascript">
  <!--
  function over1(xx)
  {
   document.getElementById(xx).style.%if;(evarso="on")outline="#C0FEFF solid 6px"%else;backgroundColor="#CBFECE"%end;;
   return false;
  }
  function out1(xx)
  {
   document.getElementById(xx).style.%if;(evarso="on")outline="none"%else;backgroundColor=""%end;;
   return false;
  }
  -->
</script>

Note that GeneWeb does not perform any language interpretation ([text to be translated]) within HTML comments!

Macros (%x)

See Macros for a description of their use and a better/updated table.

Below is the result of calling all 26 lower case possible macros: This table is automatically generated by inserting a bit of HTML/GeneWeb code into the notes of one person in your base. The corresponding code is here

Table of GeneWeb macros.

Commands (m=XXX)

List of the commands appearing in URL with the form:

%prefix;m=COMMAND;p=param1;n=param2; (or %sm=COMMAND... in notes and m=SRC .txt files)

This list does not claim to be exhaustive, and does not "explain" what each command does!

 "A"
 "AD"
 "ADD_FAM"
 "ADD_FAM_OK"
 "ADD_IND"
 "ADD_IND_OK"
 "ADD_PAR"
 "ADD_PAR_OK"
 "AM"
 "AN"
 "ANM"
 "AS_OK"
 "C"
 "CAL"
 "CAST"
 "CHANGE_WIZ_VIS"
 "CHG_CHN"
 "CHG_CHN_OK"
 "CHG_EVT_FAM_ORD"
 "CHG_EVT_FAM_ORD_OK"
 "CHG_EVT_IND_ORD"
 "CHG_EVT_IND_ORD_OK"
 "CHG_FAM_ORD"
 "CHG_FAM_ORD_OK"
 "CONN_WIZ"
 "D"
 "DAG" *
 "DATE"
 "DEL_FAM"
 "DEL_FAM_OK"
 "DEL_IMAGE"
 "DEL_IMAGE_OK"
 "DEL_IND"
 "DEL_IND_OK"
 "F"
 "FIXBASE"
 "FIXBASE_OK"
 "FORUM_ADD"
 "FORUM_ADD_OK"
 "FORUM_DEL"
 "FORUM_P_P"
 "FORUM_SEARCH"
 "FORUM_VAL"
 "FORUM_VIEW"
 "H"
 "HIST"
 "HIST_CLEAN"
 "HIST_CLEAN_OK"
 "HIST_DIFF"
 "HIST_SEARCH"
 "IM" *
 "IMH" *
 "INV_FAM"
 "INV_FAM_OK"
 "KILL_ANC"
 "L"
 "LB"
 "LD"
 "LINKED"
 "LL"
 "LM"
 "LOG"
 "MISC_NOTES"
 "MISC_NOTES_SEARCH"
 "MOD_DATA"
 "MOD_DATA_OK"
 "MOD_FAM"
 "MOD_FAM_OK"
 "MOD_IND"
 "MOD_IND_OK"
 "MOD_NOTES"
 "MOD_NOTES_OK"
 "MOD_WIZNOTES"
 "MOD_WIZNOTES_OK"
 "MRG"
 "MRG_DUP"
 "MRG_DUP_FAM_Y_N"
 "MRG_DUP_IND_Y_N"
 "MRG_FAM"
 "MRG_FAM_OK"
 "MRG_IND"
 "MRG_IND_OK"
 "MRG_MOD_FAM_OK"
 "MRG_MOD_IND_OK"
 "N"
 "NAME"
 "NG"
 "NOTES"
 "OA"
 "OE"
 "OPT"
 "P"
 "POP_PYR"
 "PPS"
 "PS"
 "R"
 "REQUEST"
 "RL"
 "RLM" *
 "S"
 "SND_IMAGE"
 "SND_IMAGE_OK"
 "SRC" *
 "STAT"
 "TP"
 "TT"
 "U"
 "VIEW_WIZNOTES" *
 "WIZNOTES" *
 "WIZNOTES_SEARCH" *

Commands marked with a * are documented below:

Variables (evar and bvar)

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

bvar

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:

%if; (bvar.new_var = "sometext" ) 
    ... perform some specific action ...
%end;

evar

Similarly, if we have added a new variable in the URL of the query to GeneWeb (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 %evar.tree;, for instance:

<title>Tree with %evar.tree; generations</title>

A way to build the list of those variables is to search for evar.xxx and/or e.xxx in template files.
There are potentially few variables used in .ml code, that are parts of conf.env to be searched with p_getenv

Some examples of evar usage in gwd#Some_frequently_used_evars

var

The special variable var is treated in the following fashion within notes, sources and comments: If you define in the .gwf file a variable var_text=some_text, then invoquing the macro %vtext; in a note or a template will produce the text some_text as in the following example:

var_who=Bond, James Bond

"My name is %vwho;." in a note will be transformed into "My name is Bond, James Bond.".

This feature is used by some to facilitate signature of sources. The .gwf file contains a list of var_nickname definitions whose value is a full name and possibly a pointer to a page containing more detailed information:

var_henri=<a href="http://site/base?p=Firstname;n=lastname">First_name Lastname</a>

(no %x or %macro; in the value of the parameter!!).

Note: in latest version 7 of GeneWeb, the wiki syntax can be used in the parameter as in:

var_who=[[james/bond/James Bond]]

which will include the text "James Bond" and a link to the corresponding page.

Bvar variables used in templates

 access_by_key
 always_surname
 auth_file
 authorized_wizards_notes
 base_notes_title
 birth_symbol
 can_kill_ancestors
 can_send_image
 carrousel
 com
 counter
 css
 css_prop
 datalist_fn
 datalist_occu
 datalist_place
 datalist_sn
 datalist_src
 datalist_z
 death_symbol
 default_fnav_images
 default_fnav_semi
 default_fnav_spouse
 default_image
 default_image_no
 default_lang
 default_sosa_ref
 defaut_lang
 disable_forum
 display_sosa
 display_timeline
 event_age
 fn_sn_switch
 friend_passwd
 friend_passwd_file
 full_siblings
 hide_advanced_request
 history
 history_diff
 jquery
 latest_event
 max_anc_level
 max_anc_tree
 max_cousins_level
 max_dates
 max_desc_level
 max_desc_tree
 max_rlm_nbr
 maxlev
 menu
 misc
 module_perso_ix
 module_perso_tplnb
 motd
 move_comment
 moved
 multi_parents
 no_image_for_visitor
 no_note_for_visitor
 notextarea
 origin_file
 p_mod
 particles
 perso_module_modnum
 perso_module_tplnum
 plugins
 propose_add_family
 propose_alias
 propose_place_surnames
 propose_qualifier
 propose_titles
 setup_http
 setup_link
 show_consang
 show_flag
 show_invisible
 static_path
 template
 timeline
 tuxfamily
 txt
 uppercase
 use_cdn
 var_img_ext
 var_t_BIRTHA
 var_t_DEATHA
 var_t_MARRIAGEA
 visitor_access
 visitor_access_msg_en
 visitor_access_msg_lg
 welcome_logo
 welcome_logo_style
 wide
 wizard_descr_file
 wizard_just_friend
 wizard_passwd
 wizard_passwd_file

Bvar variables used by Gwd

always_surname, yes
auth_file
base_notes_title
body_prop
can_kill_ancestors
can_send_image, no
conf.base_env
counter, no
death_symbol, †
default_sosa_ref
disable_forum, yes
dump_bad_images, yes
expand_env
fast_alphabetic, yes
forum_exclude_file
friend_passwd
friend_passwd_file
has_events
history, yes
history_diff
history_path
image_prefix
images_path
latest_event
long_date, yes
max_anc_tree
max_ancestor_implex
max_cousins
max_desc_level
max_desc_tree
max_images_size
max_nb_update
max_rlm_nbr
moderator_file
no
notes_alias_file
notify_change
passwd_
place
place_surname_link_to_ind, yes
places_inverted, yes
print_advanced_title, yes
propose_add_family, no
ptempl, yes
red_if_not_exist
short_place_threshold
show_query_time
static_path
template
var_
visitor_access, no
wizard_descr_file
wizard_passwd_file

The bvar name is sometimes followed by one of its options (yes/no)

Building trees through direct url construction

See trees or trees/fr


GeneWeb Manual

Rembrandt Old Man Reading a Book.jpg

Use and manage genealogical databases

Technical annex