Difference between revisions of "Template:Lead"

From Biowikifarm Metawiki
Jump to: navigation, search
Line 41: Line 41:
  
 
The code makes a distinction between terminal (taxon) and ongoing leads, which is made heuristically based on length of parameter 3 (up to 4 characters a lead-pointer is assumed).
 
The code makes a distinction between terminal (taxon) and ongoing leads, which is made heuristically based on length of parameter 3 (up to 4 characters a lead-pointer is assumed).
 +
 
The distinction influences the markup in the final column (kind of link) and the position of the colspan attribute. The colspan assigns column 4 either to the left or right column, allowing some overlap between long statement lines and long taxon names. To function, at least one row must use are real td cell with a defined width for column 4; currently this is achieved by adding an empty row as the last row in the table.
 
The distinction influences the markup in the final column (kind of link) and the position of the colspan attribute. The colspan assigns column 4 either to the left or right column, allowing some overlap between long statement lines and long taxon names. To function, at least one row must use are real td cell with a defined width for column 4; currently this is achieved by adding an empty row as the last row in the table.
  
The span with white background are an experiment to provide on the one hand lead dots (by means of a background graphic defined on the class td.lead) and on the other hand have the text normally on top. This is NOT WORKING OPTIMAL and may be turned off later.
+
The span with white background are an experiment to provide on the one hand lead dots (by means of a background graphic defined on the class td.lead) and on the other hand have the text normally on top.  
  
 
The first parameter may be a simple lead number "1", a number plus lead-code (1a, 1b, 1*, 1', 1", etc.) or a number with a backlink in round parenthesis: "2 (1)". We need to parse out the round brackets. First split the string at the "(" using explode, then remove ")" by replacing: {{#replace:{{{1}}}|)| }}.
 
The first parameter may be a simple lead number "1", a number plus lead-code (1a, 1b, 1*, 1', 1", etc.) or a number with a backlink in round parenthesis: "2 (1)". We need to parse out the round brackets. First split the string at the "(" using explode, then remove ")" by replacing: {{#replace:{{{1}}}|)| }}.
 +
 +
Named parameters are: image, images, description. No 4th or 4th unnamed parameter exists
  
 
Lead pointers: anchors must start with letter, therefore L prefixed, also id added to support multiple keys on a single wiki page. Note: no real trim function is present, but a custom template does the job.
 
Lead pointers: anchors must start with letter, therefore L prefixed, also id added to support multiple keys on a single wiki page. Note: no real trim function is present, but a custom template does the job.

Revision as of 18:34, 19 November 2008

<tr id="L{{{1}}}row" style="vertical-align:top;"><td id="L{{{1}}}" class="leadnr">Lead number missing!</td><td></td><td class="lead" >Lead statement missing! </td><td class="leadresult" colspan="2"> {{{3}}}</td></tr>

[edit] Template documentation

See Key Start for the main documentation.