Vorlage:Switch: Unterschied zwischen den Versionen

Aus Bayernflora
Wechseln zu: Navigation, Suche
K (1 Version)
 
(2 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
{{{case: {{{1|}}}|{{{default|}}}}}}<noinclude>
+
<noinclude>A key-like branching, a decision between a single level of alternatives, here especially to choose among alternative available identification tools. The term "Key Switch" was avoided, because identification tools may be simple image field guides, tabular overviews, or even free-form text.
  
<nowiki> {{switch
+
'''Planned name in German: "Weiche".'''
|Wert_der_verglichen_werden_soll
+
|case: foo=Hallo
+
|case: bar=Welt
+
|default=Weder''foo'' noch''bar''
+
}}</nowiki>
+
  
Diese Vorlage könnte bei anderen Templates hilfreich sein.
+
Technical Note: The requirements for this template are that both jKey and mobileKey can follow it as if it were a key. For this purpose, both parameter names and the output hmtl layout follow the Key Start and Decision templates.
Wenn das so geht wie gedacht.
+
 
:{{User:Porter/sig}}
+
==Parameters==
</noinclude>
+
For the entire Switch:
 +
* id (optional, defaults to "switch" if not given)
 +
* title
 +
* remarks
 +
* taxon name
 +
* taxon rank (= Genus, Family/Familie, etc.)
 +
* taxon common names
 +
** "common names" (older deprecated synonym, should be replaced over time with taxon common names)
 +
* group (= Flora, Fauna, etc.)
 +
* parent taxon
 +
* (avoid to use: "parent key" and "parent key text" if a taxon name is given)
 +
* (no creator, category, geoscope, audience, edited by etc.!)
 +
 
 +
For the alternatives of the decision:
 +
* result 1…15
 +
* result text 1…15
 +
* statement 1…15
 +
* remarks 1…15
 +
* image 1…15a, 1…15b
 +
:* caption 1…15a, 1…15b
 +
:* image 1…15a width, 1…15b width
 +
:* image 1…15a height, 1…15b height
 +
* subheading 1…15
 +
* subheading style 1…15
 +
 
 +
== Current architecture ==
 +
 +
  ├ [[Template:Switch/Lead |Switch/Lead]]
 +
  └ [[Template:Switch/doc |Switch/doc]]
 +
  + [[Template:StripFormatting |StripFormatting]]
 +
  + [[Template:Lead/GalleryItemNoCaption |Lead/GalleryItemNoCaption]]
 +
  + [[Template:Multilingual |Multilingual]]
 +
 
 +
----
 +
 
 +
[[Category:Single-access key templates]]
 +
</noinclude><includeonly><div id="{{{id|switch}}}" class="decisiontree jkey-nocontrols"><!--remove for testing: CSS class jkey-nocontrols-->
 +
<table class="dt-caption"><!--CSS class collapsible: more.../less-->
 +
<tr><th>{{{title|}}}{{
 +
#ifeq: {{{taxon name|}}} | {{PAGENAME}} <!-- page title italic, add to category; optionally as Group: Id-tool (rank):
 +
Beispiel: Index der Gattungen (Flora, wissenschaftliche Namen)
 +
-->|{{Italic title}}[[Category:{{Multilingual|de=Index der|en=Index of}} {{
 +
#switch:{{lc:{{{taxon rank|}}} }}
 +
| art
 +
| species  = {{Multilingual|de=Arten mit infraspezifischen Taxa|en=species with infraspecific taxa}}
 +
| genus
 +
| gattung  = {{Multilingual|de=Gattungen|en=genera}}
 +
| unterfamilie
 +
| subfamily = {{Multilingual|de=Unterfamilien|en=subfamilies}}
 +
| familie
 +
| family    = {{Multilingual|de=Familien|en=families}}
 +
| ordnung
 +
| order    = {{Multilingual|de=Ordnungen|en=orders}}
 +
| #default  = {{Multilingual|de=Taxa anderer Ränge|en=taxa of other ranks}}
 +
}} ({{First-of | {{{group|}}} | {{Multilingual|de=Andere Gruppen|en=Other Groups}} }}, {{Multilingual|de=wissenschaftliche Namen|en=scientific names}})]]<!--END: if taxon name = Pagename. -->}}{{
 +
#if: {{{parent taxon|}}}|[[Category:{{{parent taxon}}}]]}}{{
 +
#if: {{{common names|}}}{{{taxon common names|}}}{{{parent key|}}}{{{parent taxon|}}}
 +
  |<!--THEN: tax. com. names/parent key--><nowiki> </nowiki>(<span class="dt-commonnames">{{{common names|}}}{{{taxon common names|}}}</span><!--
 +
  -->{{#if: {{{parent key|}}}{{{parent taxon|}}}
 +
      |<!--THEN: parent key
 +
  -->{{#if: {{{taxon common names|}}}{{{common names|}}}
 +
      |,<nowiki> </nowiki>
 +
      }}<!--
 +
      Wiki-link to parent key. Note: if "parent key" or "parent key text" missing, parent taxon is used (best practice is using only parent taxon).
 +
    -->[[{{StripFormatting|1={{First-of |1={{{parent key|}}}|2={{{parent taxon|}}}}}<!-- -->}}<!--
 +
    link text:-->|{{First-of |1={{{parent key text|}}}|2={{{parent key|}}}|3={{{parent taxon|}}}}}]]<!--
 +
  -->}})
 +
  |<!--false: taxon common names/parent key
 +
-->{{#if: {{{parent key|}}}
 +
    |
 +
    |<!-- add category -->[[Category:{{Multilingual|de=Intern - Übergeordneter Schlüssel fehlt|en=Management - Keys without Parent key}}]]<!--
 +
-->}}
 +
}} [[File:Disambig.svg|x20px|{{Multilingual|de=Weiche zu Bestimmungsschlüsseln
 +
        |en=Switch between determination keys}}<!--
 +
-->]]</th></tr>{{
 +
#if: {{{remarks|}}}|<tr><td>{{{remarks|}}}</td></tr>
 +
}}</table>
 +
<table class="dt-body" cellpadding="0" cellspacing="0">
 +
<!-- up to 15 further alternatives -->
 +
<!-- Link 1 -->
 +
{{#if: {{{result text 1|}}}{{{result 1|}}}
 +
|{{Switch/Lead
 +
  | keyID  ={{{id}}} 
 +
  | subheading      = {{{subheading 1|}}}
 +
  | subheadingstyle = {{{subheading style 1|}}}
 +
  | resulttext= {{#if: {{{result text 1|}}} | {{{result text 1}}} | {{{result 1}}}}}
 +
  | resultlink= {{StripFormatting | {{{result 1}}}}}
 +
  | remarks  = {{{remarks 1|}}}
 +
  | image a  = {{{image 1a|}}}
 +
  | caption a = {{{caption 1a|}}}
 +
  | image a width  = {{{image 1a width|80}}}
 +
  | image a height = {{{image 1a height|80}}}
 +
  | image b  = {{{image 1b|}}}
 +
  | caption b = {{{caption 1b|}}}
 +
  | image b width  = {{{image 1b width|80}}}
 +
  | image b height = {{{image 1b height|80}}}
 +
  }}
 +
}}<!-- Link 2 -->
 +
{{#if: {{{result text 2|}}}{{{result 2|}}}
 +
|{{Switch/Lead
 +
  | keyID  ={{{id}}} 
 +
  | subheading      = {{{subheading 2|}}}
 +
  | subheadingstyle = {{{subheading style 2|}}}
 +
  | resulttext= {{#if: {{{result text 2|}}} | {{{result text 2}}} | {{{result 2}}}}}
 +
  | resultlink= {{StripFormatting | {{{result 2}}}}}
 +
  | remarks  = {{{remarks 2|}}}
 +
  | image a  = {{{image 2a|}}}
 +
  | caption a = {{{caption 2a|}}}
 +
  | image a width  = {{{image 2a width|80}}}
 +
  | image a height = {{{image 2a height|80}}}
 +
  | image b  = {{{image 2b|}}}
 +
  | caption b = {{{caption 2b|}}}
 +
  | image b width  = {{{image 2b width|80}}}
 +
  | image b height = {{{image 2b height|80}}}
 +
  }}
 +
}}<!-- Link 3 -->
 +
{{#if: {{{result text 3|}}}{{{result 3|}}}
 +
|{{Switch/Lead
 +
  | keyID  ={{{id}}} 
 +
  | subheading      = {{{subheading 3|}}}
 +
  | subheadingstyle = {{{subheading style 3|}}}
 +
  | resulttext= {{#if: {{{result text 3|}}} | {{{result text 3}}} | {{{result 3}}}}}
 +
  | resultlink= {{StripFormatting | {{{result 3}}}}}
 +
  | remarks  = {{{remarks 3|}}}
 +
  | image a  = {{{image 3a|}}}
 +
  | caption a = {{{caption 3a|}}}
 +
  | image a width  = {{{image 3a width|80}}}
 +
  | image a height = {{{image 3a height|80}}}
 +
  | image b  = {{{image 3b|}}}
 +
  | caption b = {{{caption 3b|}}}
 +
  | image b width  = {{{image 3b width|80}}}
 +
  | image b height = {{{image 3b height|80}}}
 +
  }}
 +
}}<!-- Link 4 -->
 +
{{#if: {{{result text 4|}}}{{{result 4|}}}
 +
|{{Switch/Lead
 +
  | keyID  ={{{id}}} 
 +
  | subheading      = {{{subheading 4|}}}
 +
  | subheadingstyle = {{{subheading style 4|}}}
 +
  | resulttext= {{#if: {{{result text 4|}}} | {{{result text 4}}} | {{{result 4}}}}}
 +
  | resultlink= {{StripFormatting | {{{result 4}}}}}
 +
  | remarks  = {{{remarks 4|}}}
 +
  | image a  = {{{image 4a|}}}
 +
  | caption a = {{{caption 4a|}}}
 +
  | image a width  = {{{image 4a width|80}}}
 +
  | image a height = {{{image 4a height|80}}}
 +
  | image b  = {{{image 4b|}}}
 +
  | caption b = {{{caption 4b|}}}
 +
  | image b width  = {{{image 4b width|80}}}
 +
  | image b height = {{{image 4b height|80}}}
 +
  }}
 +
}}<!-- Link 5 -->
 +
{{#if: {{{result text 5|}}}{{{result 5|}}}
 +
|{{Switch/Lead
 +
  | keyID  ={{{id}}} 
 +
  | subheading      = {{{subheading 5|}}}
 +
  | subheadingstyle = {{{subheading style 5|}}}
 +
  | resulttext= {{#if: {{{result text 5|}}} | {{{result text 5}}} | {{{result 5}}}}}
 +
  | resultlink= {{StripFormatting | {{{result 5}}}}}
 +
  | remarks  = {{{remarks 5|}}}
 +
  | image a  = {{{image 5a|}}}
 +
  | caption a = {{{caption 5a|}}}
 +
  | image a width  = {{{image 5a width|80}}}
 +
  | image a height = {{{image 5a height|80}}}
 +
  | image b  = {{{image 5b|}}}
 +
  | caption b = {{{caption 5b|}}}
 +
  | image b width  = {{{image 5b width|80}}}
 +
  | image b height = {{{image 5b height|80}}}
 +
  }}
 +
}}<!-- Link 6 -->
 +
{{#if: {{{result text 6|}}}{{{result 6|}}}
 +
|{{Switch/Lead
 +
  | keyID  ={{{id}}} 
 +
  | subheading      = {{{subheading 6|}}}
 +
  | subheadingstyle = {{{subheading style 6|}}}
 +
  | resulttext= {{#if: {{{result text 6|}}} | {{{result text 6}}} | {{{result 6}}}}}
 +
  | resultlink= {{StripFormatting | {{{result 6}}}}}
 +
  | remarks  = {{{remarks 6|}}}
 +
  | image a  = {{{image 6a|}}}
 +
  | caption a = {{{caption 6a|}}}
 +
  | image a width  = {{{image 6a width|80}}}
 +
  | image a height = {{{image 6a height|80}}}
 +
  | image b  = {{{image 6b|}}}
 +
  | caption b = {{{caption 6b|}}}
 +
  | image b width  = {{{image 6b width|80}}}
 +
  | image b height = {{{image 6b height|80}}}
 +
  }}
 +
}}<!-- Link 7 -->
 +
{{#if: {{{result text 7|}}}{{{result 7|}}}
 +
|{{Switch/Lead
 +
  | keyID  ={{{id}}} 
 +
  | subheading      = {{{subheading 7|}}}
 +
  | subheadingstyle = {{{subheading style 7|}}}
 +
  | resulttext= {{#if: {{{result text 7|}}} | {{{result text 7}}} | {{{result 7}}}}}
 +
  | resultlink= {{StripFormatting | {{{result 7}}}}}
 +
  | remarks  = {{{remarks 7|}}}
 +
  | image a  = {{{image 7a|}}}
 +
  | caption a = {{{caption 7a|}}}
 +
  | image a width  = {{{image 7a width|80}}}
 +
  | image a height = {{{image 7a height|80}}}
 +
  | image b  = {{{image 7b|}}}
 +
  | caption b = {{{caption 7b|}}}
 +
  | image b width  = {{{image 7b width|80}}}
 +
  | image b height = {{{image 7b height|80}}}
 +
  }}
 +
}}<!-- Link 8 -->
 +
{{#if: {{{result text 8|}}}{{{result 8|}}}
 +
|{{Switch/Lead
 +
  | keyID  ={{{id}}} 
 +
  | subheading      = {{{subheading 8|}}}
 +
  | subheadingstyle = {{{subheading style 8|}}}
 +
  | resulttext= {{#if: {{{result text 8|}}} | {{{result text 8}}} | {{{result 8}}}}}
 +
  | resultlink= {{StripFormatting | {{{result 8}}}}}
 +
  | remarks  = {{{remarks 8|}}}
 +
  | image a  = {{{image 8a|}}}
 +
  | caption a = {{{caption 8a|}}}
 +
  | image a width  = {{{image 8a width|80}}}
 +
  | image a height = {{{image 8a height|80}}}
 +
  | image b  = {{{image 8b|}}}
 +
  | caption b = {{{caption 8b|}}}
 +
  | image b width  = {{{image 8b width|80}}}
 +
  | image b height = {{{image 8b height|80}}}
 +
  }}
 +
}}<!-- Link 9 -->
 +
{{#if: {{{result text 9|}}}{{{result 9|}}}
 +
|{{Switch/Lead
 +
  | keyID  ={{{id}}} 
 +
  | subheading      = {{{subheading 9|}}}
 +
  | subheadingstyle = {{{subheading style 9|}}}
 +
  | resulttext= {{#if: {{{result text 9|}}} | {{{result text 9}}} | {{{result 9}}}}}
 +
  | resultlink= {{StripFormatting | {{{result 9}}}}}
 +
  | remarks  = {{{remarks 9|}}}
 +
  | image a  = {{{image 9a|}}}
 +
  | caption a = {{{caption 9a|}}}
 +
  | image a width  = {{{image 9a width|80}}}
 +
  | image a height = {{{image 9a height|80}}}
 +
  | image b  = {{{image 9b|}}}
 +
  | caption b = {{{caption 9b|}}}
 +
  | image b width  = {{{image 9b width|80}}}
 +
  | image b height = {{{image 9b height|80}}}
 +
  }}
 +
}}<!-- Link 10 -->
 +
{{#if: {{{result text 10|}}}{{{result 10|}}}
 +
|{{Switch/Lead
 +
  | keyID  ={{{id}}} 
 +
  | subheading      = {{{subheading 10|}}}
 +
  | subheadingstyle = {{{subheading style 10|}}}
 +
  | resulttext= {{#if: {{{result text 10|}}} | {{{result text 10}}} | {{{result 10}}}}}
 +
  | resultlink= {{StripFormatting | {{{result 10}}}}}
 +
  | remarks  = {{{remarks 10|}}}
 +
  | image a  = {{{image 10a|}}}
 +
  | caption a = {{{caption 10a|}}}
 +
  | image a width  = {{{image 10a width|80}}}
 +
  | image a height = {{{image 10a height|80}}}
 +
  | image b  = {{{image 10b|}}}
 +
  | caption b = {{{caption 10b|}}}
 +
  | image b width  = {{{image 10b width|80}}}
 +
  | image b height = {{{image 10b height|80}}}
 +
  }}
 +
}}<!-- Link 11 -->
 +
{{#if: {{{result text 11|}}}{{{result 11|}}}
 +
|{{Switch/Lead
 +
  | keyID  ={{{id}}} 
 +
  | subheading      = {{{subheading 11|}}}
 +
  | subheadingstyle = {{{subheading style 11|}}}
 +
  | resulttext= {{#if: {{{result text 11|}}} | {{{result text 11}}} | {{{result 11}}}}}
 +
  | resultlink= {{StripFormatting | {{{result 11}}}}}
 +
  | remarks  = {{{remarks 11|}}}
 +
  | image a  = {{{image 11a|}}}
 +
  | caption a = {{{caption 11a|}}}
 +
  | image a width  = {{{image 11a width|80}}}
 +
  | image a height = {{{image 11a height|80}}}
 +
  | image b  = {{{image 11b|}}}
 +
  | caption b = {{{caption 11b|}}}
 +
  | image b width  = {{{image 11b width|80}}}
 +
  | image b height = {{{image 11b height|80}}}
 +
  }}
 +
}}<!-- Link 12 -->
 +
{{#if: {{{result text 12|}}}{{{result 12|}}}
 +
|{{Switch/Lead
 +
  | keyID  ={{{id}}} 
 +
  | subheading      = {{{subheading 12|}}}
 +
  | subheadingstyle = {{{subheading style 12|}}}
 +
  | resulttext= {{#if: {{{result text 12|}}} | {{{result text 12}}} | {{{result 12}}}}}
 +
  | resultlink= {{StripFormatting | {{{result 12}}}}}
 +
  | remarks  = {{{remarks 12|}}}
 +
  | image a  = {{{image 12a|}}}
 +
  | caption a = {{{caption 12a|}}}
 +
  | image a width  = {{{image 12a width|80}}}
 +
  | image a height = {{{image 12a height|80}}}
 +
  | image b  = {{{image 12b|}}}
 +
  | caption b = {{{caption 12b|}}}
 +
  | image b width  = {{{image 12b width|80}}}
 +
  | image b height = {{{image 12b height|80}}}
 +
  }}
 +
}}<!-- Link 13 -->
 +
{{#if: {{{result text 13|}}}{{{result 13|}}}
 +
|{{Switch/Lead
 +
  | keyID  ={{{id}}} 
 +
  | subheading      = {{{subheading 13|}}}
 +
  | subheadingstyle = {{{subheading style 13|}}}
 +
  | resulttext= {{#if: {{{result text 13|}}} | {{{result text 13}}} | {{{result 13}}}}}
 +
  | resultlink= {{StripFormatting | {{{result 13}}}}}
 +
  | remarks  = {{{remarks 13|}}}
 +
  | image a  = {{{image 13a|}}}
 +
  | caption a = {{{caption 13a|}}}
 +
  | image a width  = {{{image 13a width|80}}}
 +
  | image a height = {{{image 13a height|80}}}
 +
  | image b  = {{{image 13b|}}}
 +
  | caption b = {{{caption 13b|}}}
 +
  | image b width  = {{{image 13b width|80}}}
 +
  | image b height = {{{image 13b height|80}}}
 +
  }}
 +
}}<!-- Link 14 -->
 +
{{#if: {{{result text 14|}}}{{{result 14|}}}
 +
|{{Switch/Lead
 +
  | keyID  ={{{id}}} 
 +
  | subheading      = {{{subheading 14|}}}
 +
  | subheadingstyle = {{{subheading style 14|}}}
 +
  | resulttext= {{#if: {{{result text 14|}}} | {{{result text 14}}} | {{{result 14}}}}}
 +
  | resultlink= {{StripFormatting | {{{result 14}}}}}
 +
  | remarks  = {{{remarks 14|}}}
 +
  | image a  = {{{image 14a|}}}
 +
  | caption a = {{{caption 14a|}}}
 +
  | image a width  = {{{image 14a width|80}}}
 +
  | image a height = {{{image 14a height|80}}}
 +
  | image b  = {{{image 14b|}}}
 +
  | caption b = {{{caption 14b|}}}
 +
  | image b width  = {{{image 14b width|80}}}
 +
  | image b height = {{{image 14b height|80}}}
 +
  }}
 +
}}<!-- Link 15 -->
 +
{{#if: {{{result text 15|}}}{{{result 15|}}}
 +
|{{Switch/Lead
 +
  | keyID  ={{{id}}} 
 +
  | subheading      = {{{subheading 15|}}}
 +
  | subheadingstyle = {{{subheading style 15|}}}
 +
  | resulttext= {{#if: {{{result text 15|}}} | {{{result text 15}}} | {{{result 15}}}}}
 +
  | resultlink= {{StripFormatting | {{{result 15}}}}}
 +
  | remarks  = {{{remarks 15|}}}
 +
  | image a  = {{{image 15a|}}}
 +
  | caption a = {{{caption 15a|}}}
 +
  | image a width  = {{{image 15a width|80}}}
 +
  | image a height = {{{image 15a height|80}}}
 +
  | image b  = {{{image 15b|}}}
 +
  | caption b = {{{caption 15b|}}}
 +
  | image b width  = {{{image 15b width|80}}}
 +
  | image b height = {{{image 15b height|80}}}
 +
  }}
 +
}}
 +
</table></div><span class="DECISIONTREE_END_MARKER"></span>
 +
</includeonly>

Aktuelle Version vom 5. Dezember 2013, 10:27 Uhr

A key-like branching, a decision between a single level of alternatives, here especially to choose among alternative available identification tools. The term "Key Switch" was avoided, because identification tools may be simple image field guides, tabular overviews, or even free-form text.

Planned name in German: "Weiche".

Technical Note: The requirements for this template are that both jKey and mobileKey can follow it as if it were a key. For this purpose, both parameter names and the output hmtl layout follow the Key Start and Decision templates.

Parameters

For the entire Switch:

  • id (optional, defaults to "switch" if not given)
  • title
  • remarks
  • taxon name
  • taxon rank (= Genus, Family/Familie, etc.)
  • taxon common names
    • "common names" (older deprecated synonym, should be replaced over time with taxon common names)
  • group (= Flora, Fauna, etc.)
  • parent taxon
  • (avoid to use: "parent key" and "parent key text" if a taxon name is given)
  • (no creator, category, geoscope, audience, edited by etc.!)

For the alternatives of the decision:

  • result 1…15
  • result text 1…15
  • statement 1…15
  • remarks 1…15
  • image 1…15a, 1…15b
  • caption 1…15a, 1…15b
  • image 1…15a width, 1…15b width
  • image 1…15a height, 1…15b height
  • subheading 1…15
  • subheading style 1…15

Current architecture

Switch/LeadSwitch/doc
 + StripFormatting
 + Lead/GalleryItemNoCaption
 + Multilingual