Vorlage:Lead/Inner: Unterschied zwischen den Versionen

Aus Offene Naturführer
Wechseln zu: Navigation, Suche
(Test rückgängig)
K (subheading: if parentlead 2 + 4 else 6 colspan)
 
(22 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 12: Zeile 12:
 
     -->|,<!-- split on ,
 
     -->|,<!-- split on ,
 
     -->|§<!-- assign temporary variable
 
     -->|§<!-- assign temporary variable
     -->|[[Deutscher Name::§| ]]<!-- output
+
     -->|[[dwc:vernacularName::§| ]]<!-- output
 
     -->|<!-- new output separator
 
     -->|<!-- new output separator
 
     -->}} }}{{   
 
     -->}} }}{{   
 
   #if: {{{synonyms}}}|[[Synonymliste::{{StripFormatting |{{{synonyms}}}}}| ]]}}{{   
 
   #if: {{{synonyms}}}|[[Synonymliste::{{StripFormatting |{{{synonyms}}}}}| ]]}}{{   
   #if: {{{scientificname}}}|[[Wissenschaftlicher Name::{{StripFormatting | {{{scientificname}}}}}| ]]}}<!--
+
   #if: {{{scientificname}}}|[[dwc:scientificName::{{StripFormatting | {{{scientificname}}}}}| ]]}}<!--
  
 
// English properties
 
// English properties
 
-->| #default =[[Category:Keys based on lead template]]<!-- Hidden cat for SWM form!
 
-->| #default =[[Category:Keys based on lead template]]<!-- Hidden cat for SWM form!
  
! ENGLISH SEMANTIC PROPERTIES NOT YET DEFINED
+
// ! ENGLISH SEMANTIC PROPERTIES NOT YET DEFINED
  
// PART 0, END switch CONTENTLANGUAGE
 
 
-->}}<!--  
 
-->}}<!--  
 
+
// PART 1. Spacer rows and subheadings above a lead row
 
+
-->{{#ifeq: {{{coupletID}}}|{{#var: decisiontreePreviousCouplet}}<!--
// PART 1. Manage spacer rows and subheadings above a lead row
+
-->{{#ifeq: {{{leadID}}}|{{#var: decisiontreePreviousCouplet}}<!--
+
 
// THEN 2nd/3rd/etc lead in a couplet, normal start
 
// THEN 2nd/3rd/etc lead in a couplet, normal start
 
-->|{{#vardefine: decisiontreeAlternative|{{#expr: {{#var: decisiontreeAlternative}}+1}}}}<!--
 
-->|{{#vardefine: decisiontreeAlternative|{{#expr: {{#var: decisiontreeAlternative}}+1}}}}<!--
   --><tr id="{{{leadID}}}_{{#var:decisiontreeAlternative}}_row" class="dt-row">{{
+
   --><tr id="{{{IDprefix}}}{{{coupletID}}}_{{#var:decisiontreeAlternative}}_row" class="dt-row">{{
 
       #if:{{{parentlead}}}<!-- THEN: indent 2 columns -->|<td></td><td></td>}}
 
       #if:{{{parentlead}}}<!-- THEN: indent 2 columns -->|<td></td><td></td>}}
       <td class="dt-nodeid">{{{displayID}}}</td><!--
+
       <td <!-- (td is filled and closed at end!)
 
// ELSE first lead; suppress spacer row for first couplet of key or nested subkeys
 
// ELSE first lead; suppress spacer row for first couplet of key or nested subkeys
 
-->|{{#if: {{#ifeq: 0|{{#var: decisiontreePreviousCouplet}}|FIRSTCOUPLET|{{{parentlead}}}}}<!--
 
-->|{{#if: {{#ifeq: 0|{{#var: decisiontreePreviousCouplet}}|FIRSTCOUPLET|{{{parentlead}}}}}<!--
Zeile 40: Zeile 37:
 
     -->|<tr class="dt-hspacer"><td colspan="6"></td></tr><!--
 
     -->|<tr class="dt-hspacer"><td colspan="6"></td></tr><!--
 
     -->}}{{
 
     -->}}{{
   #vardefine: decisiontreePreviousCouplet|{{{leadID}}}}}{{
+
   #vardefine: decisiontreePreviousCouplet|{{{coupletID}}}}}{{
 
   #vardefine: decisiontreeAlternative|1}}{{
 
   #vardefine: decisiontreeAlternative|1}}{{
 
   #if: {{{subheading}}}<!--
 
   #if: {{{subheading}}}<!--
 
     -->|<tr class="dt-subheading"><!--
 
     -->|<tr class="dt-subheading"><!--
     --><td colspan="6" style="font-weight:bold;padding:0.5em 0.75em 0.3em 0.75em; {{
+
     -->{{#if:{{{parentlead}}}<!--
 +
      then: indent 2 columns -->|<td></td><td></td><td colspan="4" <!--
 +
      else: full six columns -->|<td colspan="6" }} style="font-weight:bold;padding:0.5em 0.75em 0.3em 0.75em; {{
 
     #switch: {{lc:{{{subheadingstyle}}}}}
 
     #switch: {{lc:{{{subheadingstyle}}}}}
       |<!-- empty style parameter = next switch option = orange:-->
+
       |<!-- empty style parameter next option=orange:-->
 
       | orange    = background-color:#FCFFEC; border:1px solid #ffc51a;
 
       | orange    = background-color:#FCFFEC; border:1px solid #ffc51a;
 
       | green    = background-color:#e5febe; border:1px solid #c5de9e;
 
       | green    = background-color:#e5febe; border:1px solid #c5de9e;
Zeile 59: Zeile 58:
 
   -->}}<!--
 
   -->}}<!--
 
   // Next column is lead id for first alternative.
 
   // Next column is lead id for first alternative.
   --><tr id="{{{leadID}}}_row" class="dt-row">{{
+
   --><tr id="{{{IDprefix}}}{{{coupletID}}}_row" class="dt-row">{{
 
     #if:{{{parentlead}}}<!-- THEN: indent 2 columns -->|<td></td><td></td>}}
 
     #if:{{{parentlead}}}<!-- THEN: indent 2 columns -->|<td></td><td></td>}}
     <td id="{{{leadID}}}" class="dt-nodeid">{{{displayID}}}</td><!--
+
     <td id="{{{IDprefix}}}{{{coupletID}}}" <!-- (td is filled and closed at end!)
// END PART 1, Manage spacer rows and subheadings above a lead row
+
// END PART 1, Spacer rows and subheadings above a lead row
-->}}<!--
+
-->}} class="dt-nodeid">{{#ifeq:{{{withinCoupletID}}}|–|–|{{{coupletID}}}}}</td><!--
  
 
// PART 2. Prepare lead core.
 
// PART 2. Prepare lead core.
// 2nd column contains either backlink or lead-differentiators (*, ', -, etc.);
+
// 2nd column contains either withinCoupletID = lead-differentiators (*, ', -, etc.) or backlink previous couplet. Both may be empty!
// Output empty column if neither is present
+
--><td class="leadalt">{{
--><td class="leadalt">{{{leadpart2}}}</td><!--
+
#ifeq:{{{withinCoupletID}}}|–||{{{withinCoupletID}}}}}{{
 +
#if:{{{leadIDbacklink}}}|&nbsp;[[#{{{IDprefix}}}{{{leadIDbacklink}}}|({{{leadIDbacklink}}})]]}}</td><!--
  
 
// 3rd column is main statement text. Uses a nested table to allow for row-by-row variable col. width
 
// 3rd column is main statement text. Uses a nested table to allow for row-by-row variable col. width
--><td class="lead-row1" {{#if: {{{parentlead}}}||colspan="3"}}><!--
+
--><td class="lead-row1" {{#if: {{{parentlead}}}|style="width:95%;"<!-- needed on table-layout: fixed -->|colspan="3"}}><!--
   --><table class="nested" width="100%" cellspacing="0" cellpadding="0"><tr><!--
+
   --><table class="nested" style="width:100%;" cellspacing="0" cellpadding="0"><tr><!--
     --><td class="leadtxt {{#if:{{{next}}}|leadon}}" width="95%"><!--
+
     --><td class="leadtxt {{#if:{{{next}}}|leadon}}" style="width:95%;" ><!--
 
     --><span class="leadspan">{{Trim|1={{{statement}}}}}&nbsp;</span><!--
 
     --><span class="leadspan">{{Trim|1={{{statement}}}}}&nbsp;</span><!--
 
     // Add mw-collapsible span (the "more…")
 
     // Add mw-collapsible span (the "more…")
     -->{{#if: {{{detailspresent}}}|<span class="leadspan noprint mw-customtoggle-{{{leadID}}}_{{#var:decisiontreeAlternative}}row"></span>}}<!--
+
     -->{{#if: {{{detailspresent|}}}|<span class="leadspan noprint {{#replace:{{ANCHORENCODE:mw-customtoggle-{{{IDprefix}}}{{{coupletID}}}_{{#var:decisiontreeAlternative}}}}|.|dot}}row"></span>}}<!--
 
     --></td><!--
 
     --></td><!--
 
     // Second column in nested table = number of further leads. NEW: both with and without result in same row (it used to be below result)!
 
     // Second column in nested table = number of further leads. NEW: both with and without result in same row (it used to be below result)!
 
     // Single triangle for normal next, double triangle if also result occurs (result and continue), e.g. where a genus is result, but species in same key.
 
     // Single triangle for normal next, double triangle if also result occurs (result and continue), e.g. where a genus is result, but species in same key.
     -->{{
+
     -->{{#if:{{{next|}}}<!-- fixed width 5%
    #if:{{{next}}}|<td class="leadresult leadon"><span class="leadon">&nbsp;[[#L{{{keyID}}}_{{{parentlead}}}{{{next}}}|&nbsp;►{{
+
then -->|<td class="leadresult leadon" style="width:5%;"><span class="leadon">&nbsp;[[#{{{IDprefix}}}{{{next}}}|&nbsp;►<!--
      #if:{{{resulttext}}}|►}}&nbsp;{{{next}}}]]</span>|<td>
+
      -->{{#if:{{{resulttext}}}|►}}&nbsp;{{{next}}}]]</span><!--
    }}</td>{{
+
      --></td><!--
 +
else -->|<td style="width:5%;"></td>}}{{
 
     #if:{{{resulttext}}}{{{nested}}}<!--
 
     #if:{{{resulttext}}}{{{nested}}}<!--
 
     // THEN New-Row-For-Results. Leaderdots for next, but not if also result is present!
 
     // THEN New-Row-For-Results. Leaderdots for next, but not if also result is present!
     -->|</tr><tr><!--
+
     -->|</tr><tr><td class="leadresult {{#if: {{{next}}} |{{#if: {{{resulttext}}}{{{commonnames}}} | |leadon}}}}" style="width:100%;" colspan="2"><!--
    --><td class="leadresult {{#if: {{{next}}} |{{#if: {{{resulttext}}}{{{commonnames}}} | |leadon}}}}" colspan="2"><!--
+
    // FIRST NESTED (= pointer to indented subkey with parentlead) in addition to result, all result-layout variants
 +
    -->{{#if:{{{nested}}}<!--
 +
      -->|<span class="leadon">&nbsp;[[#{{{IDprefix}}}{{{coupletID}}}{{{withinCoupletID}}}{{{nested}}}|&nbsp;▼▼&nbsp;{{{nested}}}]]&nbsp;&nbsp;&ndash;&nbsp;&nbsp;</span><!--
 +
    // END if nested:
 +
    -->}}<!--
  
 
     // BACKGROUND OLD/NEW RESULTSTYLE:
 
     // BACKGROUND OLD/NEW RESULTSTYLE:
     // The original ("old") layout interprets result as either free of scientific name  
+
     // The original ("old") style interprets result as either free of scientific name  
 
     //  (and it does not know which is which), and adds the common name in front.
 
     //  (and it does not know which is which), and adds the common name in front.
 
     // The new format should be able to either show free-form result text (common/scientific  
 
     // The new format should be able to either show free-form result text (common/scientific  
Zeile 96: Zeile 101:
 
     // See also schema at bottom of Template:Lead/doc
 
     // See also schema at bottom of Template:Lead/doc
 
     // TODO: introduce resultformat parameter later (= list of format options, allowing common name or scientific name to be first)
 
     // TODO: introduce resultformat parameter later (= list of format options, allowing common name or scientific name to be first)
 +
    // Now using {{#var: OtherNames}} = the gray name, presently the common name, optionally later a different one.
 
     -->{{#if: {{{resulttextoverride}}}<!--  
 
     -->{{#if: {{{resulttextoverride}}}<!--  
      -->|{{#if: {{{scientificname}}}|<!--
+
       // If scientificname exists then NEW STYLE → ignore commonnames+scientificname if resulttextoverride, ELSE OLD STYLE:-> output common names even for resulttextoverride
       // THEN: NEW LAYOUT RULES -> ignore commonnames+scientificname if resulttextoverride
+
       -->|{{#if: {{{scientificname}}}|{{#vardefine: OtherNames|}}|{{#vardefine: OtherNames|{{{commonnames}}}<!---->}}<!---->}}<!-- // END if scientificname
      // ELSE:-> output common names even for resulttextoverride
+
       -->|{{#if: {{{commonnames}}}<!--
+
        -->|<span class="commonnames">&nbsp;{{Lead/MakeCommaBreakingList | listtext={{{commonnames}}} }}&nbsp;&ndash;</span><!-- (no additional space after ndash!)
+
        -->}}<!--
+
      -->}}<!-- // END scientificname
+
 
     // ELSE: no resulttextoverride, output commonnames for both OLD and NEW LAYOUT
 
     // ELSE: no resulttextoverride, output commonnames for both OLD and NEW LAYOUT
       -->|{{#if: {{{commonnames}}}<!--
+
       -->|{{#vardefine: OtherNames|{{{commonnames}}}<!---->}}<!--
        -->|<span class="commonnames">&nbsp;{{Lead/MakeCommaBreakingList | listtext={{{commonnames}}} }}&nbsp;&ndash;</span><!--  
+
    // END resulttextoverride:
        // (no additional space after ndash!)
+
    -->}}<!-- // END NEW/OLD: rest is identical
        // DEBUG: ABOVE WAS: {{#if: {{{resulttext}}} |&nbsp;&ndash;|&#32;}}</span> // OK WITHOUT?
+
    // Output the OtherNames variable if filled. No additional space after ndash!
 +
    //   ##DEBUG## ABOVE WAS: {{#if: {{{resulttext}}} |&nbsp;&ndash;|&#32;}}</span> // OK WITHOUT?
 +
    -->{{#if: {{#var: OtherNames}}<!--
 +
        -->|<span class="commonnames">&nbsp;{{Lead/MakeCommaBreakingList | listtext={{#var:OtherNames}} }}&nbsp;&nbsp;&ndash;</span><!--
 
       -->}}<!--
 
       -->}}<!--
     // END resulttextoverride:
+
     // Now resulttext = one of resulttextoverride, scientificname, or resultlink itself.
    -->}}<!-- // END NEW/OLD LAYOUT, result itself is identical
+
 
+
    // resulttext = one of resulttextoverride, scientificname, or resultlink itself.
+
 
     // resulttext and qualifier need white background and (if together <40 char) a common nowrap:
 
     // resulttext and qualifier need white background and (if together <40 char) a common nowrap:
    --><span class="leadresults {{#ifexpr:{{#len:{{{resulttext}}}{{{resultqualifier}}} }} < 40|nowrap}}"><!--
+
  --><span class="leadresults {{#ifexpr:{{#len:{{{resulttext}}}{{{resultqualifier}}} }} < 40|nowrap}}"><!--
 
     --><span class="leadout {{#ifexpr:{{#len:{{{resulttext}}} }} < 40|nowrap}}">&nbsp;&nbsp;{{
 
     --><span class="leadout {{#ifexpr:{{#len:{{{resulttext}}} }} < 40|nowrap}}">&nbsp;&nbsp;{{
 
     #ifeq: {{#sub: {{{resultlink}}}|0|5}}|http:<!--
 
     #ifeq: {{#sub: {{{resultlink}}}|0|5}}|http:<!--
Zeile 129: Zeile 130:
 
       -->}}<!--
 
       -->}}<!--
 
     // END (if http-link)
 
     // END (if http-link)
     -->}}</span><!-- close span.leadout. span.leadresults will be closed after result qualifier!
+
     -->}}</span><!-- close span.leadout. Span.leadresults will be closed after result qualifier!
  
 
     // resultqualifier in all result-layout variants
 
     // resultqualifier in all result-layout variants
Zeile 137: Zeile 138:
 
     // END (res.qual.), + closing span.leadresults (= nowrap-span around result+qualif.)
 
     // END (res.qual.), + closing span.leadresults (= nowrap-span around result+qualif.)
 
     -->}}</span><!--  
 
     -->}}</span><!--  
 
    // NESTED (= pointer to indented subkey with parentlead) in addition to result, all result-layout variants
 
    // Note: leadpart2 may be a "*" -> forbidden in @id. BUT: some step in mediawiki will convert "*" to ".2A". OK
 
    // Note: leadpart2 could be backlink. -> ??? QUESTION: CURRENTLY suppressed for [ but not ( ?
 
    -->{{#if:{{{nested}}}<!--
 
      -->|<br /><span class="leadon">&nbsp;[[#{{{leadID}}}{{
 
      #ifeq:{{#sub:{{{leadpart2}}}|0|1}}|[|<!--THEN nothing
 
      -->|<!--ELSE -->{{{leadpart2}}}<!--
 
      -->}}{{{nested}}}|&nbsp;▼▼&nbsp;{{{nested}}}]]</span><!--
 
    // END if nested:
 
    -->}}<!--
 
 
     --></td><!--
 
     --></td><!--
 
    
 
    
Zeile 162: Zeile 152:
 
// occurrence + remarks; already combined in outer Lead template!
 
// occurrence + remarks; already combined in outer Lead template!
 
// Wrappable gallery image m/caption m" to "image r/caption r" output below detailtext
 
// Wrappable gallery image m/caption m" to "image r/caption r" output below detailtext
-->{{#if: {{{detailspresent}}}<!--
+
-->{{#if: {{{detailspresent|}}}<!--
 
// THEN  
 
// THEN  
 
-->|<tr><td class="leadextras" colspan="2"><!--
 
-->|<tr><td class="leadextras" colspan="2"><!--
--><div class="mw-collapsible mw-collapsed mw-collapsible-content leadextras" id="mw-customcollapsible-{{{leadID}}}_{{#var:decisiontreeAlternative}}row"><!--
+
--><div class="mw-collapsible mw-collapsed mw-collapsible-content leadextras" id="{{#replace:{{ANCHORENCODE:mw-customcollapsible-{{{IDprefix}}}{{{coupletID}}}_{{#var:decisiontreeAlternative}}}}|.|dot}}row"><!--
 
-->{{{detailtext}}}<!--
 
-->{{{detailtext}}}<!--
 
-->{{#if: {{{image m}}}<!--
 
-->{{#if: {{{image m}}}<!--
Zeile 195: Zeile 185:
 
-->|<table class="nested"><tr style="vertical-align:top;"><td><!--
 
-->|<table class="nested"><tr style="vertical-align:top;"><td><!--
 
-->{{#if: {{{image j}}}<!--
 
-->{{#if: {{{image j}}}<!--
   -->|<div style="padding:1em 1em 1em 0;float:left;width:{{#expr: {{Pixel2Number|{{{image j width}}}}}+15}}px;">[[{{Trim| {{{image j}}} }} |none|{{Pixel2Number|{{{image j width}}}}}x{{Pixel2Number|{{{image j height}}}}}px]]<!--
+
   -->|<div style="padding:0em 0.5em 1em 0;float:left;width:{{#expr: {{Pixel2Number|{{{image j width}}}}}+15}}px;">[[{{Trim| {{{image j}}} }} |none|{{Pixel2Number|{{{image j width}}}}}x{{Pixel2Number|{{{image j height}}}}}px]]<!--
 
     -->{{#if: {{{label j}}}|'''{{{label j}}}: '''}}{{{caption j}}}<!--
 
     -->{{#if: {{{label j}}}|'''{{{label j}}}: '''}}{{{caption j}}}<!--
 
     --></div><!--
 
     --></div><!--
 
-->}}<!--
 
-->}}<!--
 
-->{{#if: {{{image k}}}<!--
 
-->{{#if: {{{image k}}}<!--
   -->|<div style="padding:1em 1em 1em 0;float:left;width:{{#expr: {{Pixel2Number|{{{image j width}}}}}+15}}px;">[[{{Trim| {{{image k}}} }} |none|{{Pixel2Number|{{{image k width}}}}}x{{Pixel2Number|{{{image k height}}}}}px]]<!--
+
   -->|<div style="padding:0em 0.5em 1em 0;float:left;width:{{#expr: {{Pixel2Number|{{{image j width}}}}}+15}}px;">[[{{Trim| {{{image k}}} }} |none|{{Pixel2Number|{{{image k width}}}}}x{{Pixel2Number|{{{image k height}}}}}px]]<!--
 
     -->{{#if: {{{label k}}}|'''{{{label k}}}: '''}}{{{caption k}}}<!--
 
     -->{{#if: {{{label k}}}|'''{{{label k}}}: '''}}{{{caption k}}}<!--
 
     --></div><!--
 
     --></div><!--

Aktuelle Version vom 22. März 2017, 23:57 Uhr

See Key Start-Doc for the main documentation, Lead-Doc for recent technical changes of the Lead-templates.

Quelle: Offene Naturführer, Das Wiki zu Bestimmungsfragen: Vorlage:Lead/Inner. Abgerufen am 2. Juni 2025, 01:40 von https://offene-naturfuehrer.de/web/Vorlage:Lead/Inner