Difference between revisions of "Template:Lead"

From Biowikifarm Metawiki
Jump to: navigation, search
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>Version 3.0: NEW: resultlink deprecated, resulttext preferred!
+
<noinclude>Version 3.1:  
  
 +
NEW: resultlink removed,
 +
NEW: resulttext deprecated, "result text" is preferred!
 +
NEW: resultqualifier deprecated, "result qualifier" is preferred!
 +
New: common names allowed (and should perhaps be preferred over commonnames! -- TODO: also allow common names in Key Start
  
Previous new: Nested subkey. STATUS: Tested, resultlink and image j/k working
+
Previous new: Nested subkey. STATUS: Tested, result text and image j/k working
  
 
New parameters: nested (the first lead number of a nested key that identifies the current lead as its parentlead. parentlead = identifying a lead as nested within the parentlead (the leads are indented, and the parentlead identifier become part of the nested lead id/next-lead values).
 
New parameters: nested (the first lead number of a nested key that identifies the current lead as its parentlead. parentlead = identifying a lead as nested within the parentlead (the leads are indented, and the parentlead identifier become part of the nested lead id/next-lead values).
  
a) Simplified, no more image-no-resize-parameter (manually set size for very small images), no more link to next/result behind image, no more little metadata icons (which were necessary because of redirecting the main links. Javascript runs almost everywhere, former solution was very complicated and removed by javascript code! -- b) new image k, intended to be always displayed (no autohide) BELOW the statement text (for larger, wide in-key images). -- c) new parameter "resultlink" for overriding the default resultlink = unformatted result text. -- d) new parameter "resultqualifier=" for male/female/white form, etc.; may also be used for scientific names, if result is desired to link to the common name. -- c) Image numbering adjusted to simplify creating a decision-based template (one template covering all leads, like the decision horizontal template. Called by outer template, Collapsible/collapsed added, lead images in right sidebar (up to five primary, "image a" to "image e", images side-by-side), non-hideable below statement (2 images, "image j"/"image k") and hidable below (secondary, "image m" to "image r" etc, max 6 images, wrapping gallery style).
+
a) Simplified, no more image-no-resize-parameter (manually set size for very small images), no more link to next/result behind image, no more little metadata icons (which were necessary because of redirecting the main links. Javascript runs almost everywhere, former solution was very complicated and removed by javascript code! -- b) new image k, intended to be always displayed (no autohide) BELOW the statement text (for larger, wide in-key images). -- c) obsolete -- d) new parameter "resultqualifier=" for male/female/white form, etc.; may also be used for scientific names, if result is desired to link to the common name. -- c) Image numbering adjusted to simplify creating a decision-based template (one template covering all leads, like the decision horizontal template. Called by outer template, Collapsible/collapsed added, lead images in right sidebar (up to five primary, "image a" to "image e", images side-by-side), non-hideable below statement (2 images, "image j"/"image k") and hidable below (secondary, "image m" to "image r" etc, max 6 images, wrapping gallery style).
  
 
PROCESS: a) Handle the subheading parameter directly (creating a visual separator (bold) above a couplet, usually summarizing identification progress and highlighting "sections" of a key). b) Error handling and combining detail text already occurs here. c) Call [[Template:Lead/Inner]], passing calculated fields like the parsed lead-ID to be used multiple times.  
 
PROCESS: a) Handle the subheading parameter directly (creating a visual separator (bold) above a couplet, usually summarizing identification progress and highlighting "sections" of a key). b) Error handling and combining detail text already occurs here. c) Call [[Template:Lead/Inner]], passing calculated fields like the parsed lead-ID to be used multiple times.  
Line 31: Line 35:
 
statement  ={{{2|'''Lead statement missing!'''}}}|
 
statement  ={{{2|'''Lead statement missing!'''}}}|
 
next      ={{Trim|{{{3|}}}}}|
 
next      ={{Trim|{{{3|}}}}}|
commonnames={{{commonnames|}}}|
+
commonnames={{{commonnames|}}}{{{common names|}}}|
resulttext ={{#if: {{{resulttext|}}}|{{{resulttext|}}}|<!--ELSE:-->{{{result|}}}}}|
+
resulttext ={{#if: {{{result text|}}}{{{resulttext|}}}|{{{result text|}}}{{{resulttext|}}}|<!--ELSE:-->{{{result|}}}}}|
resultlink ={{#if: {{{resultlink|}}}|{{{resultlink|}}}|<!--
+
resultlink ={{Lead/StripFormatting|1={{{result|}}}}}|
  ELSE (by default link to format-stripped result):-->{{Lead/StripFormatting|1={{{result|}}}}}
+
resultqualifier ={{{result qualifier|}}}{{{resultqualifier|}}}|
}}|
+
resultqualifier ={{{resultqualifier|}}}|
+
 
errors    =<!--ERROR REPORTING: Any content in 4th and later unnamed parameters is an error.-->{{
 
errors    =<!--ERROR REPORTING: Any content in 4th and later unnamed parameters is an error.-->{{
  #if: {{{4|}}}{{{commonname|}}}{{{image|}}}{{{images|}}}{{{synonym|}}}{{{remark|}}}<!--
+
  #if: {{{4|}}}{{{commonname|}}}{{{common name|}}}{{{image|}}}{{{images|}}}{{{synonym|}}}{{{remark|}}}{{{results|}}}<!--
  THEN:-->|Error: You may have an erroneous 4th unnamed parameter (vertical bar without a field name), or you may use "commonname/remark/synonym/image/images" instead of "commonnames/remarks/synonyms/image 1a" etc. The content is: '''{{{4|}}} {{{5|}}} {{{commonname|}}} {{{synonym|}}} {{{remark|}}} {{{image|}}} {{{images|}}}'''. To add descriptions use <code><nowiki>|description=Your text|</nowiki></code>; to add one or several synonyms use <code><nowiki>|synonmys=Synonym 1; Synonym 2|</nowiki></code>; to add images use <code><nowiki>|image 1a=Image:YourImage.jpg |caption 1a=Your Caption</nowiki></code> (images a to e are in the sidebar, j following below lead text, with j/k always visible and, images m to r in the "more"-information area below the lead).<!--
+
  THEN:-->|Error: You may have an erroneous 4th unnamed parameter (vertical bar without a field name), or you may use "commonname/common name/remark/results/synonym/image/images" instead of "common names/remarks/result/synonyms/image a" etc. The content is: '''{{{4|}}} {{{5|}}} {{{commonname|}}} {{{common name|}}} {{{synonym|}}} {{{remark|}}} {{{results|}}} {{{image|}}} {{{images|}}}'''. To add descriptions use <code><nowiki>|description=Your text|</nowiki></code>; to add one or several synonyms use <code><nowiki>|synonmys=Synonym 1; Synonym 2|</nowiki></code>; to add images use <code><nowiki>|image 1a=Image:YourImage.jpg |caption 1a=Your Caption</nowiki></code> (images a to e are in the sidebar, j following below lead text, with j/k always visible and, images m to r in the "more"-information area below the lead).<!--
 
  END ERROR REPORTING.
 
  END ERROR REPORTING.
 
  START DETAIL TEXT:-->}}|
 
  START DETAIL TEXT:-->}}|

Latest revision as of 17:02, 6 March 2010

Version 3.1:

NEW: resultlink removed, NEW: resulttext deprecated, "result text" is preferred! NEW: resultqualifier deprecated, "result qualifier" is preferred! New: common names allowed (and should perhaps be preferred over commonnames! -- TODO: also allow common names in Key Start

Previous new: Nested subkey. STATUS: Tested, result text and image j/k working

New parameters: nested (the first lead number of a nested key that identifies the current lead as its parentlead. parentlead = identifying a lead as nested within the parentlead (the leads are indented, and the parentlead identifier become part of the nested lead id/next-lead values).

a) Simplified, no more image-no-resize-parameter (manually set size for very small images), no more link to next/result behind image, no more little metadata icons (which were necessary because of redirecting the main links. Javascript runs almost everywhere, former solution was very complicated and removed by javascript code! -- b) new image k, intended to be always displayed (no autohide) BELOW the statement text (for larger, wide in-key images). -- c) obsolete -- d) new parameter "resultqualifier=" for male/female/white form, etc.; may also be used for scientific names, if result is desired to link to the common name. -- c) Image numbering adjusted to simplify creating a decision-based template (one template covering all leads, like the decision horizontal template. Called by outer template, Collapsible/collapsed added, lead images in right sidebar (up to five primary, "image a" to "image e", images side-by-side), non-hideable below statement (2 images, "image j"/"image k") and hidable below (secondary, "image m" to "image r" etc, max 6 images, wrapping gallery style).

PROCESS: a) Handle the subheading parameter directly (creating a visual separator (bold) above a couplet, usually summarizing identification progress and highlighting "sections" of a key). b) Error handling and combining detail text already occurs here. c) Call Template:Lead/Inner, passing calculated fields like the parsed lead-ID to be used multiple times.

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:decisiontreeID}}" (here, in Lead itself and Lead/SplitNumber).

[edit] Template documentation

See Key Start for the main documentation.