From GeneWeb
Jump to: navigation, search
GeneWeb macros
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

Insert the following line in the note of an individual :
<a href="%sm=SRC;v=macros">Macros table</a>
and place this whole page in file "bases/src/base/macros.txt"


<a href="%s"><img src="images/up.png" width="24" height="29"></a>

<h2>GeneWeb Macros</h2>
The following table lists the macros available when personalizing GeneWeb pages. <br>
The second columns provides the result of executing the macro in the current context.

<table border="1" width="100%" height="60">

<tr><td> Macro </td><td> Example use</td><td> Result</td><td> What it does </td></tr>
<tr><td> &percnt;a </td><td> &percnt;a</td><td> %a</td><td> Displays name of sosa reference (See &percnt;lz) </td></tr>
<tr><td> &percnt;b </td><td> &percnt;b</td><td> %b</td><td> Value of "body_prop" (in base.gwf) </td></tr>
<tr><td> &percnt;c </td><td> &percnt;c</td><td> %c</td><td> Number of queries for the welcome page </td></tr>
<tr><td> &percnt;d </td><td> &percnt;d</td><td> %d</td><td> Date of first visit </td></tr>
<tr><td> &percnt;D </td><td> &percnt;D</td><td> %D</td><td> Date of first visit </td></tr>
<tr><td> &percnt;e </td><td> &percnt;e</td><td> %e</td><td> Character set </td></tr>
<tr><td> &percnt;f </td><td> &percnt;f</td><td> %f</td><td> In server mode, base name followed by password. In CGI mode, name of the CGI command (ex: gwd.exe) </td></tr>
<tr><td> &percnt;g </td><td> &percnt;g</td><td> %g</td><td> In server mode, same as "f". In CGI mode, name of the command, followed by "?b=basename;" </td></tr>
<tr><td> &percnt;h </td><td> &percnt;h</td><td> %h</td><td> A list of <input type="hidden" name="var" value="val"/>\n for each hidden url variable </td></tr>
<tr><td> &percnt;i </td><td> &percnt;i</td><td> %i</td><td> Highlight color</td></tr>
<tr><td> &percnt;j </td><td> &percnt;j</td><td> %j</td><td> Include hed.txt file </td></tr>
<tr><td> &percnt;k </td><td> &percnt;k</td><td> %k</td><td> Value of the action parameter of a http GET/PUT command </td></tr>
<tr><td> &percnt;l </td><td> &percnt;l</td><td> %l</td><td> Language </td></tr>
<tr><td> &percnt;L </td><td> &percnt;L</td><td> %L</td><td> Left (style: used in align="%%L")</td></tr>
<tr><td> &percnt;m </td><td> &percnt;m</td><td> %m</td><td> Value of latest_event (in base.gwf) </td></tr>
<tr><td> &percnt;n </td><td> &percnt;n</td><td> %n</td><td> Number of persons in the base </td></tr>
<tr><td> &percnt;N </td><td> &percnt;N</td><td> %N</td><td> Content of <!-- .... --> as first line of base.gwb/notes file </td></tr>
<tr><td> &percnt;o </td><td> &percnt;o</td><td> %o</td><td> Value of %%image_prefix; (see doc for image_prefix details (to be completed)) </td></tr>
<tr><td> &percnt;p </td><td> &percnt;p</td><td> %p</td><td> noop </td></tr>
<tr><td> &percnt;P </td><td> &percnt;P</td><td> %Pc</td><td> next (%%Pc) </td></tr>
<tr><td> &percnt;q </td><td> &percnt;q</td><td> %q</td><td> Number of queries </td></tr>
<tr><td> &percnt;r </td><td> &percnt;rfile </td><td> %rtest
  </td><td> Reads file bases/src/base/test.txt) (file must be followed by "end of line") </td></tr>
<tr><td> &percnt;R </td><td> &percnt;R </td><td> %R </td><td> Right (style: used in align="%%R")</td></tr>
<tr><td> &percnt;s </td><td> &percnt;s</td><td> %s</td><td> Value of &percnt;f followed by "?" and contextual variables (ex: "toto?lang=it;iz=8233;") </td></tr>
<tr><td> &percnt;t </td><td> &percnt;t</td><td> %t</td><td> Base name </td></tr>
<tr><td> &percnt;T </td><td> &percnt;T</td><td> %T</td><td> Value of %%doctype; (%%Vdoctype;=%Vdoctype;) (Given that doctype translates into <-- .... -->, nothing is visible in the result column. Look at the sources to verify) </td></tr>
<tr><td> &percnt;u </td><td> &percnt;ufr;</td><td> %ufr;</td><td> returns "Français" if lang=fr, and "French" if lang=en (dont forget the ;)</td></tr>
<tr><td> &percnt;U </td><td> &percnt;U</td><td> %U</td><td> User name </td></tr>
<tr><td> &percnt;v </td><td> &percnt;v</td><td> %v</td><td> Returns GeneWeb version number </td></tr>
<tr><td> &percnt;v </td><td> &percnt;vtext;</td><td> %v</td><td> Specific to m=NOTES context<br>
  returns the value of bvar.var_text </td></tr>
<tr><td> &percnt;V </td><td> &percnt;Vvar;</td><td> %Vtest;</td><td> Value of bvar.var (in base.gwf) example %%Vtest; </td></tr>
<tr><td> &percnt;w </td><td> &percnt;w</td><td> %w</td><td> Link to previous page (with back arrow icon)</td></tr>
<tr><td> &percnt;x </td><td> &percnt;x</td><td> %x</td><td> noop </td></tr>
<tr><td> &percnt;X </td><td> &percnt;Xvar;</td><td> %Xv;</td><td> Value of evar.var (in URL) example %%Xv; </td></tr>
<tr><td> &percnt;y </td><td> &percnt;y</td><td> %y</td><td> noop </td></tr>
<tr><td> &percnt;/ </td><td> &percnt;/</td><td> %/</td><td> if doctype = "html-4.01" then "" else "/" (used to terminate html tags as in <br%%/> -> <br%/>  </td></tr>
<tr><td> &percnt;% </td><td> &percnt;%</td><td> %%</td><td> % </td></tr>


<tr><td> <b>&percnt;I</b>a </td><td> <b>&percnt;I</b>aYes&percnt;E <b>&percnt;I</b><font color="blue">N</font>aNo&percnt;E </td><td> %IaYes%E %INaNo%E </td><td> auth_file exists. Global access restriction is on (see [[Access]])</td></tr>
<tr><td> <b>&percnt;I</b>c </td><td> <b>&percnt;I</b>cYes&percnt;E <b>&percnt;I</b><font color="blue">N</font>cNo&percnt;E </td><td> %IcYes%E %INcNo%E </td><td> Cannot handle passwords </td></tr>
<tr><td> <b>&percnt;I</b>f </td><td> <b>&percnt;I</b>fYes&percnt;E <b>&percnt;I</b><font color="blue">N</font>fNo&percnt;E </td><td> %IfYes%E %INfNo%E </td><td> We are "Friend" </td></tr>
<tr><td> <b>&percnt;I</b>h </td><td> <b>&percnt;I</b>hYes&percnt;E <b>&percnt;I</b><font color="blue">N</font>hNo&percnt;E </td><td> %IhYes%E %INhNo%E </td><td> There is a history file </td></tr>
<tr><td> <b>&percnt;I</b>j </td><td> <b>&percnt;I</b>jYes&percnt;E <b>&percnt;I</b><font color="blue">N</font>jNo&percnt;E </td><td> %IjYes%E %INjNo%E </td><td> Wizard_just_friend is active </td></tr>
<tr><td> <b>&percnt;I</b>l </td><td> <b>&percnt;I</b>lYes&percnt;E <b>&percnt;I</b><font color="blue">N</font>lNo&percnt;E </td><td> %IlYes%E %INlNo%E </td><td> Browser handles tables </td></tr>
<tr><td> <b>&percnt;I</b>m </td><td> <b>&percnt;I</b>mYes&percnt;E <b>&percnt;I</b><font color="blue">N</font>mNo&percnt;E </td><td> %ImYes%E %INmNo%E </td><td> notes_links <> [] </td></tr>
<tr><td> <b>&percnt;I</b>n </td><td> <b>&percnt;I</b>nYes&percnt;E <b>&percnt;I</b><font color="blue">N</font>nNo&percnt;E </td><td> %InYes%E %INnNo%E </td><td> There is a base note file </td></tr>
<tr><td> <b>&percnt;I</b>o </td><td> <b>&percnt;I</b>oYes&percnt;E <b>&percnt;I</b><font color="blue">N</font>oNo&percnt;E </td><td> %IoYes%E %INoNo%E </td><td> Notes dir exists </td></tr>
<tr><td> <b>&percnt;I</b>p </td><td> <b>&percnt;I</b>ptest;Yes&percnt;E <b>&percnt;I</b><font color="blue">N</font>ptest;No&percnt;E </td><td> %Iptest;Yes%E %INptest;No%E </td><td> Base env variable <> "" (var terminated by ;)</td></tr>
<tr><td> <b>&percnt;I</b>s </td><td> <b>&percnt;I</b>sYes&percnt;E <b>&percnt;I</b><font color="blue">N</font>sNo&percnt;E </td><td> %Istest;Yes%E %INstest;No%E </td><td> Base env variable <> "no" </td></tr>
<tr><td> <b>&percnt;I</b>w </td><td> <b>&percnt;I</b>wYes&percnt;E <b>&percnt;I</b><font color="blue">N</font>wNo&percnt;E </td><td> %IwYes%E %INwNo%E </td><td> We are "Wizard" </td></tr>
<tr><td> <b>&percnt;I</b>z </td><td> <b>&percnt;I</b>zYes&percnt;E <b>&percnt;I</b><font color="blue">N</font>zNo&percnt;E </td><td> %IzYes%E %INzNo%E </td><td> Sosa ref exists </td></tr>
<tr><td> </td><td> </td><td colspan=2> Expressions are limited to the following macros : a c f j l m n o p s w z which return True or False </td></tr>
<tr><td> <b>&percnt;I</b>t </td><td> <b>&percnt;I</b>tYes&percnt;E <b>&percnt;I</b><font color="blue">N</font>tNo&percnt;E </td><td> %ItYes%E %INtNo%E </td><td> Bad macro (twice) (prints !!!!x!!!!, returns True) </td></tr>

<tr><td> <b>&percnt;I</b><font color="blue">N</font> </td><td> <b>&percnt;I</b><font color="blue">N</font>[<em>expression</em>] </td><td>  </td><td> Inverts the result of [<em>expression</em>] (See <b><b>&percnt;I</b>f</b> thru <b><b>&percnt;I</b>z</b> for usage examples)</td></tr>

<tr><td> <b>&percnt;I</b>| </td><td> <b>&percnt;I</b>|fwfrd or wiz%<b>E</b> </td><td> %I|wffrd or wiz%E </td>
  <td> Logical "or" with two following expressions </td></tr>

<tr><td> <b>&percnt;I</b>& </td><td> <b>&percnt;I</b>&whw and history file%<b>E</b> </td><td> %IN&wfw and history file%E </td>
  <td> Logical "and" with two following expressions </td></tr>

%w Previous page