Maintenance
All wikis at Biowikifarm are in read-only mode due to the restoration after a severe cyberattack in October 2023.
After 1 year being shut down the Biowikifarm is online again.
You see the latest restored version from 18th October 2023.
Difference between revisions of "Template:Lead"
Line 22: | Line 22: | ||
// Next column is the main statement text plus the result. The horizontal distribution of the two columns is variable (using lead2col inner table): | // Next column is the main statement text plus the result. The horizontal distribution of the two columns is variable (using lead2col inner table): | ||
− | --><td class="lead2col"><table class="lead2col {{#if: {{{synonyms|}}}{{{description|}}}{{{occurrence|}}}{{{remarks|}}}{{{ | + | --><td class="lead2col"><table class="lead2col {{#if: {{{synonyms|}}}{{{description|}}}{{{occurrence|}}}{{{remarks|}}}{{{image 2a|}}}<!--make table collabsible if EXTRA txt/imgs exist:-->|<nowiki> </nowiki>collapsible collapsed}}" width="100%" cellspacing="0" cellpadding="0"><tr> |
<th class="lead" {{#ifexpr:{{#len:{{{3|}}}{{{result|}}} }} < 5 |width="95%"}}><span class="leadtext">{{Trim|1={{{2|'''Lead statement missing!'''}}}}} </span></th><!-- | <th class="lead" {{#ifexpr:{{#len:{{{3|}}}{{{result|}}} }} < 5 |width="95%"}}><span class="leadtext">{{Trim|1={{{2|'''Lead statement missing!'''}}}}} </span></th><!-- | ||
// Next column is a pointer to further leads and/or to a taxon/subkey result; both will be autolinked. | // Next column is a pointer to further leads and/or to a taxon/subkey result; both will be autolinked. | ||
Line 30: | Line 30: | ||
#if: {{{commonnames|}}}<!--(Note: replace function insert nbsp and at commata; <nowiki> </nowiki> and   are ways to create a blank that is not trimmed; nowiki works better in find,   may word better in replace. ATTENTION: this is sensitive code, it still behaves slightly strange but alternatives did not work at all. Also: replacing with spans to have no-wrap and wrappable spans does not work in mw 1.16, spans are "sanitized"!) | #if: {{{commonnames|}}}<!--(Note: replace function insert nbsp and at commata; <nowiki> </nowiki> and   are ways to create a blank that is not trimmed; nowiki works better in find,   may word better in replace. ATTENTION: this is sensitive code, it still behaves slightly strange but alternatives did not work at all. Also: replacing with spans to have no-wrap and wrappable spans does not work in mw 1.16, spans are "sanitized"!) | ||
THEN-->|<span class="commonnames"> {{#replace:{{#replace:{{#replace:{{{commonnames}}}|,<nowiki> </nowiki>|,§§}}|<nowiki> </nowiki>| }}|§§| }}</span><span class="leadtext"> </span><!-- | THEN-->|<span class="commonnames"> {{#replace:{{#replace:{{#replace:{{{commonnames}}}|,<nowiki> </nowiki>|,§§}}|<nowiki> </nowiki>| }}|§§| }}</span><span class="leadtext"> </span><!-- | ||
− | + | END if commonnames -->}}<span class="leadresult"> [[{{Lead/StripFormatting|1={{{result|}}} }}|{{{result}}}]]</span></td>{{ | |
− | #if:{{{3|}}}<!-- NEXT-LEAD-POINTER in addition to result: | + | #if:{{{3|}}}<!-- NEXT-LEAD-POINTER in addition to "result": |
− | // | + | // (result+next-lead co-occur, e.g., for species-result where key continues with subspecies. Put into NEW row, double arrow:) |
THEN-->|</tr><tr><td colspan="2" class="leadresult"><span class="leadtext"> [[#L{{#var:SingleAccessKeyID}}{{Trim|{{{3}}} }}|►► {{Trim|{{{3}}} }}]]</span></td><!-- | THEN-->|</tr><tr><td colspan="2" class="leadresult"><span class="leadtext"> [[#L{{#var:SingleAccessKeyID}}{{Trim|{{{3}}} }}|►► {{Trim|{{{3}}} }}]]</span></td><!-- | ||
End if next-lead inside result -->}}<!-- | End if next-lead inside result -->}}<!-- | ||
Line 41: | Line 41: | ||
// 1. ERROR REPORTING: Any content in 4th and later unnamed parameters is an error.-->{{ | // 1. ERROR REPORTING: Any content in 4th and later unnamed parameters is an error.-->{{ | ||
#if: {{{4|}}}{{{commonname|}}}{{{image|}}}{{{images|}}}<!-- | #if: {{{4|}}}{{{commonname|}}}{{{image|}}}{{{images|}}}<!-- | ||
− | then:-->|<tr><th colspan="2" class="leaderror">Error: You may have an erroneous 4th unnamed parameter (vertical bar without a field name), or you may use "commonname/image/images" instead of "commonnames/ | + | then:-->|<tr><th colspan="2" class="leaderror">Error: You may have an erroneous 4th unnamed parameter (vertical bar without a field name), or you may use "commonname/image/images" instead of "commonnames/image 1a" etc. The content is: {{{4|}}} {{{5|}}} {{{commonname|}}} {{{image|}}} {{{images|}}}. To add images or descriptions use <code><nowiki>|description=Your text|</nowiki></code> ''and'' <code><nowiki>|image 1a=Image:YourImage.jpg |caption 1a=Your Caption</nowiki></code>.</th></tr><!-- |
end:-->}}<!-- | end:-->}}<!-- | ||
// END ERROR REPORTING. | // END ERROR REPORTING. | ||
// START EXTRA INFO and IMAGES: Free-form text descriptions and Images are in the optional parameters: | // START EXTRA INFO and IMAGES: Free-form text descriptions and Images are in the optional parameters: | ||
− | "synonyms", "description", "occurrence", "remarks", and " | + | "synonyms", "description", "occurrence", "remarks", and "image 1a/caption 1a" to "image9/caption9". |
Images and descriptions displayed side-by-side (if only one is present this uses a 1-celled-table to simplify styling). -->{{ | Images and descriptions displayed side-by-side (if only one is present this uses a 1-celled-table to simplify styling). -->{{ | ||
− | #if: {{{synonyms|}}}{{{description|}}}{{{occurrence|}}}{{{remarks|}}}{{{ | + | #if: {{{synonyms|}}}{{{description|}}}{{{occurrence|}}}{{{remarks|}}}{{{image 2a|}}}<!-- |
THEN-->|<tr><td class="leadextras" colspan="2"><table class="leadextras" cellspacing="0" cellpadding="0" width="100%"><tr>{{ | THEN-->|<tr><td class="leadextras" colspan="2"><table class="leadextras" cellspacing="0" cellpadding="0" width="100%"><tr>{{ | ||
#if: {{{synonyms|}}}{{{description|}}}{{{occurrence|}}}{{{remarks|}}}<!-- | #if: {{{synonyms|}}}{{{description|}}}{{{occurrence|}}}{{{remarks|}}}<!-- | ||
Line 56: | Line 56: | ||
}}{{{description|}}} {{{occurrence|}}} {{{remarks|}}}</td><!-- | }}{{{description|}}} {{{occurrence|}}} {{{remarks|}}}</td><!-- | ||
// IF also images and gallerytype=normal gallery, then create new row: | // IF also images and gallerytype=normal gallery, then create new row: | ||
− | -->{{#if:{{{ | + | -->{{#if:{{{image 2a|}}}| {{#ifeq:{{lc:{{{gallerytype|}}}}}|smooth||</tr><tr>}} }} |
}}{{ | }}{{ | ||
− | #if: {{{ | + | #if: {{{image 2a|}}}<!-- at least 1 extra image present, either after extra text, or alone: START X-IMAGE CONTENT |
THEN-->|<td class="leadimages">{{#switch: {{lc: {{{gallerytype|}}} }}<!-- | THEN-->|<td class="leadimages">{{#switch: {{lc: {{{gallerytype|}}} }}<!-- | ||
-->| #default =<!-- | -->| #default =<!-- | ||
Line 65: | Line 65: | ||
// | gallerytype = smooth (using SmoothGallery extension) or (nothing/empty) | // | gallerytype = smooth (using SmoothGallery extension) or (nothing/empty) | ||
// | imagesfooter =footer text (for wrappable and smooth) | // | imagesfooter =footer text (for wrappable and smooth) | ||
− | // | | + | // | image 2a - 2i, caption 2a - 2i (for all types) |
// | captionlines = 3 (default is 2) (for wrappable only) | // | captionlines = 3 (default is 2) (for wrappable only) | ||
− | // | | + | // | image 2a - 2i width, images 2 width (for wrappable only) |
− | // | | + | // | image 2a - 2i height, images 2 height (for wrappable only) |
− | // | | + | // | images 2 resize (for wrappable only, default=1, 0 to prevent resize) |
--><table style="border:none; margin-top:0.25em;"><tr><td><!-- | --><table style="border:none; margin-top:0.25em;"><tr><td><!-- | ||
− | -->{{#if: {{{ | + | -->{{#if: {{{image 2a|}}}|{{Lead/GalleryItem|image={{{image 2a|}}}|caption={{{caption 2a|}}}|width={{{image 2a width|{{{images 2 width|180}}}}}}|height={{{image 2a height|{{{images 2 height|180}}}}}}|resize={{{images 2 resize|1}}}|lines={{{captionlines|2}}}|next={{{3|}}}|result={{{result|}}}}}}}<!-- |
− | -->{{#if: {{{ | + | -->{{#if: {{{image 2b|}}}|{{Lead/GalleryItem|image={{{image 2b|}}}|caption={{{caption 2b|}}}|width={{{image 2b width|{{{images 2 width|180}}}}}}|height={{{image 2b height|{{{images 2 height|180}}}}}}|resize={{{images 2 resize|1}}}|lines={{{captionlines|2}}}|next={{{3|}}}|result={{{result|}}}}}}}<!-- |
− | -->{{#if: {{{ | + | -->{{#if: {{{image 2c|}}}|{{Lead/GalleryItem|image={{{image 2c|}}}|caption={{{caption 2c|}}}|width={{{image 2c width|{{{images 2 width|180}}}}}}|height={{{image 2c height|{{{images 2 height|180}}}}}}|resize={{{images 2 resize|1}}}|lines={{{captionlines|2}}}|next={{{3|}}}|result={{{result|}}}}}}}<!-- |
− | -->{{#if: {{{ | + | -->{{#if: {{{image 2d|}}}|{{Lead/GalleryItem|image={{{image 2d|}}}|caption={{{caption 2d|}}}|width={{{image 2d width|{{{images 2 width|180}}}}}}|height={{{image 2d height|{{{images 2 height|180}}}}}}|resize={{{images 2 resize|1}}}|lines={{{captionlines|2}}}|next={{{3|}}}|result={{{result|}}}}}}}<!-- |
− | -->{{#if: {{{ | + | -->{{#if: {{{image 2e|}}}|{{Lead/GalleryItem|image={{{image 2e|}}}|caption={{{caption 2e|}}}|width={{{image 2e width|{{{images 2 width|180}}}}}}|height={{{image 2e height|{{{images 2 height|180}}}}}}|resize={{{images 2 resize|1}}}|lines={{{captionlines|2}}}|next={{{3|}}}|result={{{result|}}}}}}}<!-- |
− | -->{{#if: {{{ | + | -->{{#if: {{{image 2f|}}}|{{Lead/GalleryItem|image={{{image 2f|}}}|caption={{{caption 2f|}}}|width={{{image 2f width|{{{images 2 width|180}}}}}}|height={{{image 2f height|{{{images 2 height|180}}}}}}|resize={{{images 2 resize|1}}}|lines={{{captionlines|2}}}|next={{{3|}}}|result={{{result|}}}}}}}<!-- |
− | -->{{#if: {{{ | + | -->{{#if: {{{image 2g|}}}|{{Lead/GalleryItem|image={{{image 2g|}}}|caption={{{caption 2g|}}}|width={{{image 2g width|{{{images 2 width|180}}}}}}|height={{{image 2g height|{{{images 2 height|180}}}}}}|resize={{{images 2 resize|1}}}|lines={{{captionlines|2}}}|next={{{3|}}}|result={{{result|}}}}}}}<!-- |
− | -->{{#if: {{{ | + | -->{{#if: {{{image 2h|}}}|{{Lead/GalleryItem|image={{{image 2h|}}}|caption={{{caption 2h|}}}|width={{{image 2h width|{{{images 2 width|180}}}}}}|height={{{image 2h height|{{{images 2 height|180}}}}}}|resize={{{images 2 resize|1}}}|lines={{{captionlines|2}}}|next={{{3|}}}|result={{{result|}}}}}}}<!-- |
− | -->{{#if: {{{ | + | -->{{#if: {{{image 2i|}}}|{{Lead/GalleryItem|image={{{image 2i|}}}|caption={{{caption 2i|}}}|width={{{image 2i width|{{{images 2 width|180}}}}}}|height={{{image 2i height|{{{images 2 height|180}}}}}}|resize={{{images 2 resize|1}}}|lines={{{captionlines|2}}}|next={{{3|}}}|result={{{result|}}}}}}}<!-- |
--></td></tr>{{#if:{{{imagesfooter|}}}|<tr><td colspan="10" style="text-align:right; font-size:80%; line-height:1em;">{{{imagesfooter}}}</td></tr>}}</table><!-- | --></td></tr>{{#if:{{{imagesfooter|}}}|<tr><td colspan="10" style="text-align:right; font-size:80%; line-height:1em;">{{{imagesfooter}}}</td></tr>}}</table><!-- | ||
-->| smooth =<!-- | -->| smooth =<!-- | ||
Line 87: | Line 87: | ||
-->{{#sgallery: width=320 | height=240 | -->{{#sgallery: width=320 | height=240 | ||
| imagelist={{ | | imagelist={{ | ||
− | #if: {{{ | + | #if: {{{image 2a|}}} | {{{image 2a|}}}{{!}}{{{caption 2a|}}} }} |
− | {{#if: {{{ | + | {{#if: {{{image 2b|}}} | {{{image 2b|}}}{{!}}{{{caption 2b|}}} }} |
− | {{#if: {{{ | + | {{#if: {{{image 2c|}}} | {{{image 2c|}}}{{!}}{{{caption 2c|}}} }} |
− | {{#if: {{{ | + | {{#if: {{{image 2d|}}} | {{{image 2d|}}}{{!}}{{{caption 2d|}}} }} |
− | {{#if: {{{ | + | {{#if: {{{image 2e|}}} | {{{image 2e|}}}{{!}}{{{caption 2e|}}} }} |
− | {{#if: {{{ | + | {{#if: {{{image 2f|}}} | {{{image 2f|}}}{{!}}{{{caption 2f|}}} }} |
− | {{#if: {{{ | + | {{#if: {{{image 2g|}}} | {{{image 2g|}}}{{!}}{{{caption 2g|}}} }} |
− | {{#if: {{{ | + | {{#if: {{{image 2h|}}} | {{{image 2h|}}}{{!}}{{{caption 2h|}}} }} |
− | {{#if: {{{ | + | {{#if: {{{image 2i|}}} | {{{image 2i|}}}{{!}}{{{caption 2i|}}} }} |
}}{{ | }}{{ | ||
#if:{{{imagesfooter|}}}|<div style="text-align:right; font-size:80%; line-height:1em;">{{{imagesfooter}}}</div><!-- | #if:{{{imagesfooter|}}}|<div style="text-align:right; font-size:80%; line-height:1em;">{{{imagesfooter}}}</div><!-- | ||
Line 104: | Line 104: | ||
// END if any extra text or image info in a second row: -->}}<!-- | // END if any extra text or image info in a second row: -->}}<!-- | ||
// END of lead2col inner table--> | // END of lead2col inner table--> | ||
− | </table></td><td>{{#if: {{{ | + | </table></td><td>{{#if: {{{image 1a|}}}<!-- at least 1 sidebar image present, |
− | // START RIGHT SIDEBAR IMAGE CONTENT, up to 4 images, non-wrapping, Lead/GalleryItemNoCaption creates td! | + | // START RIGHT SIDEBAR IMAGE CONTENT, |
+ | // up to 4 images, non-wrapping, Lead/GalleryItemNoCaption creates td! | ||
+ | // image 1a - 1d, caption 1a - 1d | ||
+ | // image 1a - 1d width, images 1 width | ||
+ | // image width height, images 1 height | ||
+ | // images 1 resize (default = 1, 0 to prevent resize) | ||
+ | |||
THEN-->|<table style="border:none; margin-top:0.1em;margin-left:1em;"><tr><!-- | THEN-->|<table style="border:none; margin-top:0.1em;margin-left:1em;"><tr><!-- | ||
− | -->{{#if: {{{ | + | -->{{#if: {{{image 1a|}}}|{{Lead/GalleryItemNoCaption|image={{{image 1a|}}}|caption={{{caption 1a|}}}|width={{{image 1a width|{{{images 1 width|100}}}}}}|height={{{image 1a height|{{{images 1 height|100}}}}}}|resize={{{images 1 resize|1}}}|next={{{3|}}}|result={{{result|}}}}}}}<!-- |
− | -->{{#if: {{{ | + | -->{{#if: {{{image 1b|}}}|{{Lead/GalleryItemNoCaption|image={{{image 1b|}}}|caption={{{caption 1b|}}}|width={{{image 1b width|{{{images 1 width|100}}}}}}|height={{{image 1b height|{{{images 1 height|100}}}}}}|resize={{{images 1 resize|1}}}|next={{{3|}}}|result={{{result|}}}}}}}<!-- |
− | -->{{#if: {{{ | + | -->{{#if: {{{image 1c|}}}|{{Lead/GalleryItemNoCaption|image={{{image 1c|}}}|caption={{{caption 1c|}}}|width={{{image 1c width|{{{images 1 width|100}}}}}}|height={{{image 1c height|{{{images 1 height|100}}}}}}|resize={{{images 1 resize|1}}}|next={{{3|}}}|result={{{result|}}}}}}}<!-- |
− | -->{{#if: {{{ | + | -->{{#if: {{{image 1d|}}}|{{Lead/GalleryItemNoCaption|image={{{image 1d|}}}|caption={{{caption 1d|}}}|width={{{image 1d width|{{{images 1 width|100}}}}}}|height={{{image 1d height|{{{images 1 height|100}}}}}}|resize={{{images 1 resize|1}}}|next={{{3|}}}|result={{{result|}}}}}}}<!-- |
--></tr></table> | --></tr></table> | ||
}}</td></tr></includeonly> | }}</td></tr></includeonly> |
Revision as of 17:43, 6 July 2009
Version 1.9: Collapsible/collapsed added, lead images in right sidebar
Maximum in right side bar is 4; they will always be side-by-side, (no wrapping).
The main documentation for all parts of the single-access key is under Template:Key Start/doc. Add only specific notes here.
The first column contains the lead number plus an anchor (id="") to which internal links may point. Here and further below, the first Lead parameter is split into two parts using the Lead/SplitNumber template.
Note: Retrieving the id-parameter of the earlier "Key Start" template from a variable depends on the "Variables" extension being installed. On Wiki installations where this is not the case, remove the template code "{{#var:SingleAccessKeyID}}" (here, in Lead/RowStart and Lead/SplitNumber).
(Todo note: add male/female: ♀♂ and diameter/times × to edit-box character selector in wiki. Further characters: ∞≤≥≡≠⅓⅔⅛⅜⅝⅞►±‚„“‘¼½¾±≈▪●, ←↑→↓↕•…‰)
See Key Start for the main documentation.
Changes in recent versions
(The main documentation for all parts of the single-access key is under Template:Key Start/doc!)
Version 3.9.
- comments changed, partly refactored
- removed the br in front of the resultqualifier if sidebar image a etc. present
- result layout variants better integrated to save memory
- general minor optimizations
- next-lead-pointer (number on right side) now always in same row as statement, even if results are also present
Version 3.8.
Version 3.7.
- added
scientific name
and new layout for result
Additional- and subtemplates
Lead ├ Lead/SplitNumber ├ Lead/Inner ├ Lead/doc ├ Lead/GalleryItem └ Lead/GalleryItemNoCaption + Template: StripFormatting to get just text + Template: Pixel2Number eg. 300px → 300
Technical Documentation
Lead/Inner produces a table row with 6 <td>
Legend: tr#something → id="something" td.something → class="something" {something} → {{{something}}} [something] → optional ‹1-2› → colspan ┌ tr#L{keyID}_{leadID}_{decisiontreeAlternative}_row ───────────────────┐ │ [td] ┬ if {parentlead} │ │ [td] ┘ │ │ td.dt-nodeid │ └───────────────────────────────────────────────────────────────────────┘ ┌ tr.dt-subheading ─────────────────────────────────────────────────────┐ └───────────────────────────────────────────────────────────────────────┘ ┌ tr.dt-row#L{keyID}_{leadID}_row ─────────────────────────────────────┐ │ [td] ┬ if {parentlead} │ │ [td] ┘ │ │ td.dt-nodeid#L{keyID}_{leadID} │ │ td.leadalt │ │ ┌ td.lead-row1 ─────────────────────────────────────────────────────┐ │ │ │ table.nested │ │ │ │ ├ tr │ │ │ │ │ td.leadtext span.leadspan │ │ │ │ ► │ │ │ │ [td.leadresult span.leadon] │ │ │ │ ├ tr │ │ │ │ │ td.leadresult │ │ │ │ │ │ │ span.commonnames │ │ │ │ │ span.leadresults │ │ │ │ │ span.leadout │ │ │ │ │ span.resultqualifier │ │ │ │ │ span.leadon │ │ │ │ ├ tr │ │ │ │ │ th.leaderror │ │ │ │ │ │ └ tr │ │ │ │ td.leadextras │ │ │ │ │ │ div.leadextras[.mw-collapsible] │ │ │ │ table │ │ │ │ tr │ │ │ │ table (containing image m,n,o,p,q,r) → Lead/GalleryItem │ │ │ │ table.nested │ │ │ │ └ tr │ │ │ │ td │ │ │ │ div (float:left) image j,k │ │ │ └───────────────────────────────────────────────────────────────────┘ │ │ td │ │ table │ │ tr │ │ td (containing image a,b,c,d,e) → Lead/GalleryItemNoCaption │ │ div.overlaywrapper │ │ div.overlaylabel │ └───────────────────────────────────────────────────────────────────────┘
Notes:
1. The first column contains the lead number plus an anchor (id="") to which internal links may point. Here and further below, the first Lead parameter is split into two parts using the Lead/SplitNumber template.
2. Retrieving the id-parameter of the earlier "Key Start" template from a variable depends on the "Variables" extension being installed. On Wiki installations where this is not the case, remove the template code "{{#var: decisiontreeID}}" (here, in Lead itself and Lead/SplitNumber).
3. Temporarily, the template supports two versions for formatting results, depending on whether Scientific Name is present (new) or not (old). If most keys have a scientific name, then the old version may be dropped. Please attempt to create all new keys for the new format!
############### NEW OLD RESULT layout rules: #################### // ? scientificname // yes: (new layout format) // ? resulttext // yes: resulttext [, resultlink] [, next] // no : // ? commonnames // yes: commonnames - scientificname [, next] // no : scientificname [, next] // no : (old layout) // ? commonnames // yes: commonnames // ? resulttext // yes: commonnames - resulttext [, resultlink] [, next] // no : commonnames [, next] // Note: [, next] can appear in all layout variants ############################################################