Vorlage:Lead: Unterschied zwischen den Versionen

Aus Offene Naturführer BiolFlor
Wechseln zu: Navigation, Suche
(Testweise zurück zu Version vom 13. März 2012, 14:38 Uhr)
(Test beendet, zurück zur aktuellen Version)
Zeile 1: Zeile 1:
<noinclude>Version 3.2: NEWS:
+
<noinclude>{{Documentation}}
* Added error category: Category:Internal - Error in Lead template
+
[[Category:Single-access key templates]]
* removed: <s>resultlink</s>
+
</noinclude><includeonly><!--
* resulttext deprecated, "result text" is preferred!  
+
add hidden category for SMW forms
* resultqualifier deprecated, "result qualifier" is preferred!  
+
-->[[{{ns:category}}: {{#switch: {{CONTENTLANGUAGE}}<!--
* common names allowed (and should perhaps be preferred over commonnames! -- TODO: also allow common names in Key Start
+
-->|de|de-formal= Schlüssel mit Lead-Vorlage<!-- Hidden!!
* Previous new: Nested subkey. STATUS: Tested, result text and image j/k working
+
-->| #default = Keys having Lead template<!-- Hidden!!
 +
-->}}<!-- switch end
 +
-->]]<!--
  
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).
+
#########################
 +
# semantic properties
 +
#########################
 +
  -->{{#switch: {{CONTENTLANGUAGE}}<!--
 +
  German Attribute
 +
-->|de|de-formal= <!--
 +
 
 +
  commonnames
 +
  -->{{#if: {{{common names|}}}{{{commonnames|}}}<!--
 +
  then -->|{{#arraymap: {{#replace: {{{commonnames|}}}{{{common names|}}}|;|,}}<!-- values
 +
    -->|,<!-- split on ,
 +
    -->|§<!-- assign temporary variable
 +
    -->|[[Art deutsch::§| ]]<!-- output
 +
    -->|<!-- new output separator
 +
    -->}}<!--
 +
  -->}}<!--
 +
 
 +
  synonyms
 +
  -->{{#if: {{{synonyms|}}}<!--
 +
  then -->| [[Synonymliste:: {{StripFormatting | {{{synonyms|}}}<!---->}}| ]]<!--
 +
  -->}}<!--
 +
 
 +
  scientific name
 +
  -->{{#if: {{{scientific name|}}}<!--
 +
  then -->|[[Art::{{StripFormatting | {{{scientific name}}}}}| ]]<!--
 +
  -->}}<!--
  
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 "result qualifier=" 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).
+
 
 +
  English properties
 +
-->| #default = <!--
 +
-->}}<!-- switch end
  
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.
+
#########################
 +
# format template
 +
#########################
  
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 "<nowiki>{{#var:decisiontreeID}}</nowiki>" (here, in Lead itself and Lead/SplitNumber).
 
 
{{Documentation}}
 
 
[[Category:Single-access key templates]]
 
  
</noinclude><includeonly>{{Lead/Inner|
+
-->{{Lead/Inner
subheading = {{{subheading|}}}|
+
| subheading = {{{subheading|}}}
subheadingstyle = {{{subheadingstyle|}}}|
+
| subheadingstyle = {{{subheadingstyle|}}}
keyID      ={{#var:decisiontreeID}}|
+
| keyID      ={{#var:decisiontreeID}}
leadID    ={{{parentlead|}}}{{Lead/SplitNumber|{{{1|99999}}}|0|noformatting=1}}|
+
| leadID    ={{{parentlead|}}}{{Lead/SplitNumber|{{{1|99999}}}|0|noformatting=1}}
displayID  ={{Lead/SplitNumber|{{{1|Number missing!}}}|0}}|
+
| displayID  ={{Lead/SplitNumber|{{{1|Number missing!}}}|0}}
leadpart2  ={{Lead/SplitNumber|{{{1}}}|1}}|
+
| leadpart2  ={{Lead/SplitNumber|{{{1}}}|1}}
parentlead ={{{parentlead|}}}|
+
| parentlead ={{{parentlead|}}}
nested    ={{Trim|{{{nested|}}}}}|
+
| nested    ={{Trim|{{{nested|}}}}}
statement  ={{{2|'''Lead statement missing!'''}}}|
+
| statement  ={{{2|'''Lead statement missing!'''}}}
next      ={{Trim|{{{3|}}}}}|
+
| next      ={{Trim|{{{3|}}}}}
commonnames={{{commonnames|}}}{{{common names|}}}|
+
| scientificname={{{scientific name|}}}
resultqualifier ={{{result qualifier|}}}{{{resultqualifier|}}}<!-- should always be possible, e.g. “2 species“ -->|
+
| commonnames={{#replace: {{{commonnames|}}}{{{common names|}}}|;|,}}
resulttext ={{#if: {{{result text|}}}{{{resulttext|}}}|{{{result text|}}}{{{resulttext|}}}|<!--ELSE:-->{{{result|}}}}}|
+
| resultqualifier ={{{result qualifier|}}}{{{resultqualifier|}}}<!-- should always be possible, e.g. “2 species“ -->
resultlink ={{StripFormatting|1={{{result|}}}}}|
+
| resulttext ={{#if: {{{result text|}}}{{{resulttext|}}}<!--
errors    =<!--ERROR REPORTING: Any content in 4th and later unnamed parameters is an error.-->{{
+
then-->|{{{result text|}}}{{{resulttext|}}}<!--
 +
else-->|{{#if: {{{scientific name|}}} |<!-- no resulttext if no result text is given -->|{{{result|}}}}}
 +
}}
 +
| resultlink ={{StripFormatting|1={{{result|}}}}}
 +
| errors    =<!--ERROR REPORTING: Any content in 4th and later unnamed parameters is an error.-->{{
 
  #if: {{{4|}}}{{{5|}}}{{{commonname|}}}{{{common name|}}}{{{image|}}}{{{images|}}}{{{synonym|}}}{{{remark|}}}{{{results|}}}<!--
 
  #if: {{{4|}}}{{{5|}}}{{{commonname|}}}{{{common name|}}}{{{image|}}}{{{images|}}}{{{synonym|}}}{{{remark|}}}{{{results|}}}<!--
 
  THEN:-->|[[Category:Internal - Error in Lead template]]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).<!--
 
  THEN:-->|[[Category:Internal - Error in Lead template]]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:-->}}
detailtext ={{  
+
| detailtext ={{  
 
  #if: {{{synonyms|}}} |<span class="synonyms">(= {{{synonyms}}})</span><br />
 
  #if: {{{synonyms|}}} |<span class="synonyms">(= {{{synonyms}}})</span><br />
 
}}{{  
 
}}{{  
Zeile 51: Zeile 78:
 
}}{{  
 
}}{{  
 
  #if: {{{remarks|}}} |<span class="remarks">{{{remarks}}} </span>
 
  #if: {{{remarks|}}} |<span class="remarks">{{{remarks}}} </span>
}}<!--END DETAIL TEXT.-->|
+
}}<!--END DETAIL TEXT.-->
primary images width  ={{{primary images width|80}}}|
+
| primary images width  ={{{primary images width|80}}}
primary images height ={{{primary images height|80}}}|
+
| primary images height ={{{primary images height|80}}}
image a        ={{{image a|}}}|
+
| image a        ={{{image a|}}}
label a        ={{{label a|}}}|
+
| label a        ={{{label a|}}}
caption a      ={{{caption a|}}}|
+
| caption a      ={{{caption a|}}}
image a width  ={{{image a width|{{{primary images width|80}}}}}}|
+
| image a width  ={{{image a width|{{{primary images width|80}}}}}}
image a height ={{{image a height|{{{primary images height|80}}}}}}|
+
| image a height ={{{image a height|{{{primary images height|80}}}}}}
image b        ={{{image b|}}}|
+
| image b        ={{{image b|}}}
label b        ={{{label b|}}}|
+
| label b        ={{{label b|}}}
caption b      ={{{caption b|}}}|
+
| caption b      ={{{caption b|}}}
image b width  ={{{image b width|{{{primary images width|80}}}}}}|
+
| image b width  ={{{image b width|{{{primary images width|80}}}}}}
image b height ={{{image b height|{{{primary images height|80}}}}}}|
+
| image b height ={{{image b height|{{{primary images height|80}}}}}}
image c        ={{{image c|}}}|
+
| image c        ={{{image c|}}}
label c        ={{{label c|}}}|
+
| label c        ={{{label c|}}}
caption c      ={{{caption c|}}}|
+
| caption c      ={{{caption c|}}}
image c width  ={{{image c width|{{{primary images width|80}}}}}}|
+
| image c width  ={{{image c width|{{{primary images width|80}}}}}}
image c height ={{{image c height|{{{primary images height|80}}}}}}|
+
| image c height ={{{image c height|{{{primary images height|80}}}}}}
image d        ={{{image d|}}}|
+
| image d        ={{{image d|}}}
label d        ={{{label d|}}}|
+
| label d        ={{{label d|}}}
caption d      ={{{caption d|}}}|
+
| caption d      ={{{caption d|}}}
image d width  ={{{image d width|{{{primary images width|80}}}}}}|
+
| image d width  ={{{image d width|{{{primary images width|80}}}}}}
image d height ={{{image d height|{{{primary images height|80}}}}}}|
+
| image d height ={{{image d height|{{{primary images height|80}}}}}}
image e        ={{{image e|}}}|
+
| image e        ={{{image e|}}}
label e        ={{{label e|}}}|
+
| label e        ={{{label e|}}}
caption e      ={{{caption e|}}}|
+
| caption e      ={{{caption e|}}}
image e width  ={{{image e width|{{{primary images width|80}}}}}}|
+
| image e width  ={{{image e width|{{{primary images width|80}}}}}}
image e height ={{{image e height|{{{primary images height|80}}}}}}|
+
| image e height ={{{image e height|{{{primary images height|80}}}}}}
extra images width  ={{{extra images width|200}}}|
+
| extra images width  ={{{extra images width|200}}}
extra images height ={{{extra images height|200}}}|
+
| extra images height ={{{extra images height|200}}}
image j        ={{{image j|}}}|
+
| image j        ={{{image j|}}}
label j        ={{{label j|}}}|
+
| label j        ={{{label j|}}}
caption j      ={{{caption j|}}}|
+
| caption j      ={{{caption j|}}}
image j width  ={{{image j width|600}}}|
+
| image j width  ={{{image j width|600}}}
image j height ={{{image j height|400}}}|
+
| image j height ={{{image j height|400}}}
image k        ={{{image k|}}}|
+
| image k        ={{{image k|}}}
label k        ={{{label k|}}}|
+
| label k        ={{{label k|}}}
caption k      ={{{caption k|}}}|
+
| caption k      ={{{caption k|}}}
image k width  ={{{image k width|600}}}|
+
| image k width  ={{{image k width|600}}}
image k height ={{{image k height|400}}}|
+
| image k height ={{{image k height|400}}}
image m        ={{{image m|}}}|
+
| image m        ={{{image m|}}}
label m        ={{{label m|}}}|
+
| label m        ={{{label m|}}}
caption m      ={{{caption m|}}}|
+
| caption m      ={{{caption m|}}}
image m width  ={{{image m width|{{{extra images width|200}}}}}}|
+
| image m width  ={{{image m width|{{{extra images width|200}}}}}}
image m height ={{{image m height|{{{extra images height|200}}}}}}|
+
| image m height ={{{image m height|{{{extra images height|200}}}}}}
image n        ={{{image n|}}}|
+
| image n        ={{{image n|}}}
label n        ={{{label n|}}}|
+
| label n        ={{{label n|}}}
caption n      ={{{caption n|}}}|
+
| caption n      ={{{caption n|}}}
image n width  ={{{image n width|{{{extra images width|200}}}}}}|
+
| image n width  ={{{image n width|{{{extra images width|200}}}}}}
image n height ={{{image n height|{{{extra images height|200}}}}}}|
+
| image n height ={{{image n height|{{{extra images height|200}}}}}}
image o        ={{{image o|}}}|
+
| image o        ={{{image o|}}}
label o        ={{{label o|}}}|
+
| label o        ={{{label o|}}}
caption o      ={{{caption o|}}}|
+
| caption o      ={{{caption o|}}}
image o width  ={{{image o width|{{{extra images width|200}}}}}}|
+
| image o width  ={{{image o width|{{{extra images width|200}}}}}}
image o height ={{{image o height|{{{extra images height|200}}}}}}|
+
| image o height ={{{image o height|{{{extra images height|200}}}}}}
image p        ={{{image p|}}}|
+
| image p        ={{{image p|}}}
label p        ={{{label p|}}}|
+
| label p        ={{{label p|}}}
caption p      ={{{caption p|}}}|
+
| caption p      ={{{caption p|}}}
image p width  ={{{image p width|{{{extra images width|200}}}}}}|
+
| image p width  ={{{image p width|{{{extra images width|200}}}}}}
image p height ={{{image p height|{{{extra images height|200}}}}}}|
+
| image p height ={{{image p height|{{{extra images height|200}}}}}}
image q        ={{{image q|}}}|
+
| image q        ={{{image q|}}}
label q        ={{{label q|}}}|
+
| label q        ={{{label q|}}}
caption q      ={{{caption q|}}}|
+
| caption q      ={{{caption q|}}}
image q width  ={{{image q width|{{{extra images width|200}}}}}}|
+
| image q width  ={{{image q width|{{{extra images width|200}}}}}}
image q height ={{{image q height|{{{extra images height|200}}}}}}|
+
| image q height ={{{image q height|{{{extra images height|200}}}}}}
image r        ={{{image r|}}}|
+
| image r        ={{{image r|}}}
label r        ={{{label r|}}}|
+
| label r        ={{{label r|}}}
caption r      ={{{caption r|}}}|
+
| caption r      ={{{caption r|}}}
image r width  ={{{image r width|{{{extra images width|200}}}}}}|
+
| image r width  ={{{image r width|{{{extra images width|200}}}}}}
image r height ={{{image r height|{{{extra images height|200}}}}}}|
+
| image r height ={{{image r height|{{{extra images height|200}}}}}}
captionlines ={{{captionlines|2}}}|
+
| captionlines ={{{captionlines|2}}}
imagesfooter ={{{imagesfooter|}}}
+
| imagesfooter ={{{imagesfooter|}}}
 
}}</includeonly>
 
}}</includeonly>

Version vom 30. August 2012, 10:13 Uhr

[Bearbeiten] [Aktualisieren] Template-info.svg Dokumentation der Vorlage

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.

  • moved from own jKey-collapsible mechanism to MediaWiki’s mw-customcollapsible
  • introduced scientificname and new rules of the result-layout
  • saving properties for commonnames, scientificname, synonyms

Version 3.7.

Length estimate based on resulttext instead of resultlink (for empty result!!!)

Previous changes:

  • nested works now on parents with backlinks and alternatives (1 and 1*, 1 and 1'). 1 and 1- NEEDS TESTING!
  • result text+ empty result supported (non-linking result).
  • nowrap on result/qualifier reworked!
  • result=http:... now works.
  • Nested subkey ok. Resultqualifier no longer in ()
Version 3.3:
  • added scientific name and new layout for result
Version 3.2:
  • Added error category: Category:Internal - Error in Lead template
  • removed: resultlink
  • resulttext deprecated, "result text" is preferred!
  • resultqualifier deprecated, "result qualifier" is preferred!
  • common names allowed (and should perhaps be preferred over commonnames! -- TODO: also allow common names in Key Start

Older version changes:

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 "result qualifier=" 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.

Additional- and subtemplates

Lead
 ├ Lead/SplitNumberLead/InnerLead/docLead/GalleryItemLead/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
 ############################################################