Difference between revisions of "Template:Lead"
Line 12: | Line 12: | ||
* Next column is the main statement text: | * Next column is the main statement text: | ||
− | --><td class="lead" {{#ifexpr:{{#len:{{{3|}}}{{{taxon|}}}}}<5|colspan="2" width="90%" }}{{#ifexpr:{{#len:{{{3|}}}{{{taxon|}}}}}> | + | --><td class="lead" {{#ifexpr:{{#len:{{{3|}}}{{{taxon|}}}}}<5|colspan="2" width="90%" }}{{#ifexpr:{{#len:{{{3|}}}{{{taxon|}}}}}>300|colspan="3" }}><span style="background-color:#FFFFFF;">{{{2|Lead statement missing!}}} </span></td><!-- |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | </td><!-- | + | |
* Next column is either a pointer to further leads or to a taxon/subkey. The first are autolinked, the second must already manually be linked if desired. NOTE: alternatively for taxon results, it is possible to have no 3rd unnamed parameter, and a "taxon" parameter instead. | * Next column is either a pointer to further leads or to a taxon/subkey. The first are autolinked, the second must already manually be linked if desired. NOTE: alternatively for taxon results, it is possible to have no 3rd unnamed parameter, and a "taxon" parameter instead. | ||
Line 25: | Line 18: | ||
-->|<!-- THEN: lead pointer, format as internal hyperlink:--><td class="leadresult" width="5em"><span style="background-color:#FFFFFF;"> [[#L{{#var:SingleAccessKeyID}}{{Trim|{{{3}}} }}|{{Trim|{{{3|Lead pointer missing!}}} }}]]</span></td><!-- | -->|<!-- THEN: lead pointer, format as internal hyperlink:--><td class="leadresult" width="5em"><span style="background-color:#FFFFFF;"> [[#L{{#var:SingleAccessKeyID}}{{Trim|{{{3}}} }}|{{Trim|{{{3|Lead pointer missing!}}} }}]]</span></td><!-- | ||
-->|<!-- ELSE: taxon pointer; may contain links. Test size: same or separate row? | -->|<!-- ELSE: taxon pointer; may contain links. Test size: same or separate row? | ||
− | -->{{#ifexpr:{{#len:{{{3|}}}{{{taxon|}}} }}> | + | -->{{#ifexpr:{{#len:{{{3|}}}{{{taxon|}}} }}>300<!-- PROBLEM: WE ARE INTERESTED ONLY IN VISIBLE LENGTH (about 30), BUT THIS TEST LINK LENGTH, which may be a long http length... PERHAPS Some Sub(Pos( {{|}} ...???? |
-->|<!-- THEN: separate row:--></tr><tr><td></td><td></td><td class="leadresult" colspan="3"><span style="background-color:#FFFFFF;"> {{{3|}}}{{{taxon|}}}</span></td><!-- | -->|<!-- THEN: separate row:--></tr><tr><td></td><td></td><td class="leadresult" colspan="3"><span style="background-color:#FFFFFF;"> {{{3|}}}{{{taxon|}}}</span></td><!-- | ||
-->|<!-- ELSE: same row:--><td class="leadresult" colspan="2"><span style="background-color:#FFFFFF;"> {{{3|}}}{{{taxon|}}}</span></td><!-- | -->|<!-- ELSE: same row:--><td class="leadresult" colspan="2"><span style="background-color:#FFFFFF;"> {{{3|}}}{{{taxon|}}}</span></td><!-- | ||
Line 44: | Line 37: | ||
--><noinclude> | --><noinclude> | ||
{{Documentation}} | {{Documentation}} | ||
− | + | ||
+ | Development notes: | ||
This is a 5-column table, where col.1 = lead number, col.2 = optional backlink, col.3 = statement, col.4 = assigned to left or right for overlap, col.5 = lead pointer or taxon. | This is a 5-column table, where col.1 = lead number, col.2 = optional backlink, col.3 = statement, col.4 = assigned to left or right for overlap, col.5 = lead pointer or taxon. | ||
Line 61: | Line 55: | ||
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. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</noinclude> | </noinclude> |
Revision as of 00:38, 2 December 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" colspan="2" width="90%">Lead statement missing! </td><td class="leadresult" width="5em"> [[#L{{{3}}}|Lead pointer missing!]]</td></tr>
Development notes:
This is a 5-column table, where col.1 = lead number, col.2 = optional backlink, col.3 = statement, col.4 = assigned to left or right for overlap, col.5 = lead pointer or taxon.
The optional images (usually taxon images) are placed right aligned in a separate row, spanning all columns.
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 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: {{{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.