Vorlage:Lead/Inner: Unterschied zwischen den Versionen

Aus Offene Naturführer
Wechseln zu: Navigation, Suche
(Mit der vorigen Version, in der die zweite Variante von Common Names auskommentiert war, geland die Generierung des Brassica-Schlüssels. Hier Gegentest: Jetzt wieder vollständiges Template!)
(Testweise zurück zu Version vom 21. Oktober 2010, 19:38 Uhr)
Zeile 1: Zeile 1:
<noinclude>'''See [[Template:Key Start/doc| Key Start-Doc]] for the main documentation, [[Template:Lead/doc| Lead-Doc]] for recent technical changes of the Lead-templates.'''
+
<noinclude>Version 3.7.  
  
[[Category:Single-access key templates]]
+
NEW: length estimate based on resulttext instead of resultlink (for empty result!!!)
</noinclude><includeonly><!--
+
Previous changes:
// PART 0. Semantic properties and hidden category for SMW forms
+
a) nested works now on parents with backlinks and alternatives (1 and 1*, 1 and 1'). 1 and 1- NEEDS TESTING!
-->{{#switch: {{CONTENTLANGUAGE}}<!--
+
b) result text+ empty result supported (non-linking result).
 +
d) nowrap on result/qualifier reworked!
 +
d) result=http:... now works.
 +
e) Nested subkey ok. Resultqualifier no longer in ()
  
// German: Deutschsprachige Attribute
+
'''See [[Template:Key Start/doc| Key Start]] for the main documentation.'''
-->|de|de-formal=[[Category:Schlüssel mit Lead-Vorlage]]<!-- Hidden cat for SMW form!
+
  -->{{
+
  #if: {{{commonnames}}}|{{#arraymap: {{{commonnames}}}<!-- values
+
    -->|,<!-- split on ,
+
    -->|§<!-- assign temporary variable
+
    -->|[[Deutscher Name::§| ]]<!-- output
+
    -->|<!-- new output separator
+
    -->}} }}{{ 
+
  #if: {{{synonyms}}}|[[Synonymliste::{{StripFormatting |{{{synonyms}}}}}| ]]}}{{ 
+
  #if: {{{scientificname}}}|[[Wissenschaftlicher Name::{{StripFormatting | {{{scientificname}}}}}| ]]}}<!--
+
  
// English properties
+
[[Category:Single-access key templates]]
-->| #default =[[Category:Keys based on lead template]]<!-- Hidden cat for SWM form!
+
  
! ENGLISH SEMANTIC PROPERTIES NOT YET DEFINED
+
</noinclude><includeonly><!--
 +
// Creating additional space before starting a new couplet (but not between leads of the same couplet). Both this and truly unique id attributes on leads depend on "Extension:Variables" for saving the current couplet number to compare with previous to determine the position where a new couplet starts.
 +
-->{{#ifeq: {{{leadID}}}|{{#var: decisiontreePreviousCouplet}}<!--
 +
THEN (2nd/3rd/etc lead in a couplet:)
 +
-->|{{#vardefine: decisiontreeAlternative|{{#expr: {{#var: decisiontreeAlternative}}+1}}<!-- -->}}<!--
 +
  --><tr id="L{{{keyID}}}_{{{leadID}}}_{{#var:decisiontreeAlternative}}_row" class="dt-row"><!--
 +
    -->{{#if:{{{parentlead}}}
 +
        |<!--then insert two columns--><td></td><td></td><!--
 +
    -->}}<!--
 +
    --><td class="dt-nodeid">{{{displayID}}}</td><!--
 +
ELSE (first lead):
 +
-->|{{#if: {{{parentlead}}}{{#ifeq: 0|{{#var: decisiontreePreviousCouplet}}|FIRSTCOUPLET|}}<!--
 +
    then: no spacer row for nested subkey rows or before first couplet
 +
  -->|<!--
 +
    else: insert spacer
 +
-->|<tr class="dt-hspacer"><td colspan="6"></td></tr>
 +
    }}<!--
 +
-->{{#vardefine: decisiontreePreviousCouplet|{{{leadID}}}}}<!--
 +
-->{{#vardefine: decisiontreeAlternative|1}}<!--
 +
-->{{#if: {{{subheading}}}<!--
 +
  -->|<tr class="dt-subheading"><!--
 +
    --><td colspan="6" style="font-weight:bold;padding:0.5em 0.75em 0.3em 0.75em; <!--
 +
    -->{{#switch: {{lc:{{{subheadingstyle}}}}}
 +
        |<!-- empty style parameter = next swwitch option = orange:-->
 +
        | orange    = background-color:#FCFFEC; border:1px solid #ffc51a;
 +
        | green    = background-color:#e5febe; border:1px solid #c5de9e;
 +
        <!-- | pink = background-color:#FCECFF; border:1px solid #c51aff; -->
 +
        | bigorange = background-color:#FCFFEC; border:2px solid #ffc51a; font-size:120%;
 +
        | biggreen  = background-color:#e5febe; border:2px solid #c5de9e; font-size:120%;
 +
        | simple    =
 +
        | #default  = {{{subheadingstyle}}}
 +
        }}">{{{subheading}}}</td><!--
 +
  --></tr><!--
 +
  --><tr class="dt-hspacer"><td></td></tr><!--
 +
-->}}<!--END if subheading.--><!--
  
// PART 0, END switch CONTENTLANGUAGE
+
  Next column is lead id. However, if parentlead is filled, it is indented 2
 +
  columns (and the normal colspan=3 in 3rd col. is removed)
 +
--><tr id="L{{{keyID}}}_{{{leadID}}}_row" class="dt-row"><!--
 +
-->{{#if: {{{parentlead}}}<!--
 +
-->|<!--then insert two columns--><td></td><td></td><!--
 
-->}}<!--  
 
-->}}<!--  
 +
  --><td id="L{{{keyID}}}_{{{leadID}}}" class="dt-nodeid">{{{displayID}}}</td>
 +
}}<!-- End leadID == #var:decisiontreePreviousCouplet --><!--
  
 +
  Second column contains either backlink or lead-differentiators (*, ', -, etc.);
 +
  if neither is present: output empty column:
 +
  --><td class="leadalt">{{{leadpart2}}}</td><!--
  
// PART 1. Manage spacer rows and subheadings above a lead row
+
  Third column is the main statement text plus the result. To make distribution of
-->{{#ifeq: {{{leadID}}}|{{#var: decisiontreePreviousCouplet}}<!--
+
  columns variable row-by-row, this uses a nested inner table:
// THEN 2nd/3rd/etc lead in a couplet, normal start
+
   --><td class="lead-row1" {{#if:{{{parentlead}}}||colspan="3"}}><!--  
-->|{{#vardefine: decisiontreeAlternative|{{#expr: {{#var: decisiontreeAlternative}}+1}}}}<!--
+
    --><table class="nested {{#if: {{{detailtext}}}{{{image m}}}<!--make table collapsible if EXTRA txt/imgs exist:-->|<nowiki> </nowiki>collapsible collapsed}}" width="100%" cellspacing="0" cellpadding="0"><!--
   --><tr id="{{{leadID}}}_{{#var:decisiontreeAlternative}}_row" class="dt-row">{{
+
      --><tr><!--
      #if:{{{parentlead}}}<!-- THEN: indent 2 columns -->|<td></td><td></td>}}
+
        --><th class="leadtxt" {{#ifexpr:{{#len:{{{next}}}{{{resulttext}}} }} < 5 |width="95%"}}><!--  
      <td class="dt-nodeid">{{{displayID}}}</td><!--
+
          --><span class="leadspan">{{Trim|1={{{statement}}}}}&nbsp;</span><!--  
// ELSE first lead; suppress spacer row for first couplet of key or nested subkeys
+
        --></th><!--
-->|{{#if: {{#ifeq: 0|{{#var: decisiontreePreviousCouplet}}|FIRSTCOUPLET|{{{parentlead}}}}}<!--
+
    -->|<!-- THEN nothing
+
    // ELSE: insert spacer row
+
    -->|<tr class="dt-hspacer"><td colspan="6"></td></tr><!--
+
    -->}}{{
+
  #vardefine: decisiontreePreviousCouplet|{{{leadID}}}}}{{
+
  #vardefine: decisiontreeAlternative|1}}{{
+
  #if: {{{subheading}}}<!--
+
    -->|<tr class="dt-subheading"><!--
+
    --><td colspan="6" style="font-weight:bold;padding:0.5em 0.75em 0.3em 0.75em; {{
+
    #switch: {{lc:{{{subheadingstyle}}}}}
+
      |<!-- empty style parameter = next switch option = orange:-->
+
      | orange    = background-color:#FCFFEC; border:1px solid #ffc51a;
+
      | green    = background-color:#e5febe; border:1px solid #c5de9e;
+
      | bigorange = background-color:#FCFFEC; border:2px solid #ffc51a; font-size:120%;
+
      | biggreen  = background-color:#e5febe; border:2px solid #c5de9e; font-size:120%;
+
      | simple    =
+
      | #default  = {{{subheadingstyle}}}
+
      }}">{{{subheading}}}</td><!--
+
  --></tr><!--
+
  --><tr class="dt-hspacer"><td colspan="6"></td></tr><!--
+
  // END subheading:
+
  -->}}<!--
+
  // Next column is lead id for first alternative.
+
  --><tr id="{{{leadID}}}_row" class="dt-row">{{
+
    #if:{{{parentlead}}}<!-- THEN: indent 2 columns -->|<td></td><td></td>}}
+
    <td id="{{{leadID}}}" class="dt-nodeid">{{{displayID}}}</td><!--
+
// END PART 1, Manage spacer rows and subheadings above a lead row
+
-->}}<!--
+
  
// PART 2. Prepare lead core.
+
        Second column is a pointer to further leads and/or to a taxon/subkey result; both
// 2nd column contains either backlink or lead-differentiators (*, ', -, etc.);
+
        will be autolinked. "commonnames" is handled here as separate parameter to
// Output empty column if neither is present
+
        increase re-formatting options later on.
--><td class="leadalt">{{{leadpart2}}}</td><!--
+
        -->{{#if:{{{resulttext}}}{{{nested}}}<!--
 +
            depending on resultlink render plain text or link (to wiki taxon page or a dedicated subkey page):
 +
          THEN-->|<td class="leadresult"><!--
 +
          -->{{#if: {{{commonnames}}}<!--
 +
              Note: no-wrap does not works because commonnames can be multiple and long;
 +
              replace function makes blank to nbsp but reverts at commas; <nowiki> </nowiki>
 +
              and &#32; are ways to create a blank that is not trimmed; nowiki works better in
 +
              find, &#32; may work 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-->|<!-- commonnames == true
 +
            --><span class="commonnames">&nbsp;&nbsp;&nbsp;<!--
 +
            -->{{#replace:<!--
 +
              -->{{#replace:<!--
 +
                -->{{#replace:{{{commonnames}}}|,<nowiki> </nowiki>|,§§}}<!--
 +
              -->|<nowiki> </nowiki>|&nbsp;}}<!--
 +
            -->|§§|&#32;}}<!--
 +
            -->{{#if:{{{image a}}}<!-- use br if side-bar images present, else blank:-->|<br />|<nowiki> </nowiki>}}<!--
 +
            --></span><!--
 +
            END if commonnames
 +
          -->}}<!--
 +
            * Result text and qualifier need white background and (if together <40 char) a common nowrap:
 +
            --><span class="leadresults{{#ifexpr:{{#len:{{{resulttext}}}{{{resultqualifier}}} }} < 40|<nowiki> </nowiki>nowrap}}"><!--
 +
              --><span class="leadout{{#ifexpr:{{#len:{{{resulttext}}} }} < 40|<nowiki> </nowiki>nowrap}}">&nbsp;&nbsp;<!--
 +
              -->{{#ifeq: {{#sub: {{{resultlink}}}|0|5}}|http:<!--
 +
                  http-link:
 +
          THEN -->|[{{{resultlink}}} {{{resulttext}}}]<!--
 +
          ELSE -->|{{#if:{{{resultlink}}}<!--
 +
                    wiki-link:
 +
                -->|[[{{{resultlink}}}|{{{resulttext}}}]]<!--
 +
                    non-link:
 +
                -->|{{{resulttext}}}<!--
 +
            END -->}}<!--
 +
          END -->}}<!--
 +
              --></span><!--
 +
              -->{{#if: {{{resultqualifier}}}<!--
 +
          THEN -->|{{#if:{{{image a}}}<!--
 +
                    use br if side-bar images present, else a wrappable blank:
 +
                -->|<br /><!--
 +
                -->|<nowiki> </nowiki><!--
 +
                -->}}<!--
 +
              --><span class="resultqualifier{{#ifexpr:{{#len:{{{resultqualifier}}} }} < 40|<nowiki> </nowiki>nowrap}}"><!--
 +
                --><nowiki> </nowiki>{{{resultqualifier}}}<!--
 +
              --></span><!--
 +
                  end if res.qual., then closing nowrap span around result+qualif.:
 +
          END -->}}<!--
 +
          --></span><!-- END span.leadresults
 +
          -->{{#if: {{{next}}}<!--
 +
                NEXT-LEAD-POINTER in addition to "resultlink": (result+next-lead co-occur, e.g.,
 +
                for species-result where key continues with subspecies. Always new line, double
 +
                arrow:)
 +
        THEN -->|<br /><span class="leadon">&nbsp;[[#L{{{keyID}}}_{{{parentlead}}}{{{next}}}|&nbsp;►►&nbsp;{{{next}}}]]</span><!--
 +
        ELSE -->|{{#if:{{{nested}}}<!--
 +
                  nested (? pointer to indented subkey)
 +
                  Note: leadpart2 could be a backlink...
 +
            THEN-->|<br /><!--
 +
                --><span class="leadon">&nbsp;[[#L{{{keyID}}}_{{{leadID}}}<!--
 +
                  -->{{#ifeq:{{#sub:{{{leadpart2}}}|0|1}}|[<!--
 +
                    -->|<!--THEN nothing
 +
                    -->|<!--ELSE -->{{{leadpart2}}}<!--
 +
                  -->}}<!--
 +
                  -->{{{nested}}}<!--
 +
          ELSE-->|&nbsp;▼▼&nbsp;{{{nested}}}]]<!--
 +
                --></span><!--
 +
            * Note on above: leadpart2 may be a * forbidden in ids; however, some step in mediawiki will convert * to .2A
 +
          END -->}}<!-- next
 +
        END -->}}<!-- nested
 +
        --></td><!-- td.leadresult
 +
       
 +
      ELSE resulttext or nested
 +
      Only NEXT-LEAD-POINTER (without result); format as internal link:
 +
      -->|<td class="leadresult"><!--
 +
          --><span class="leadon">&nbsp;[[#L{{{keyID}}}_{{{parentlead|}}}{{{next}}}|&nbsp;►&nbsp;{{{next}}}]]</span><!--
 +
        --></td><!--
 +
  END -->}}<!-- resulttext or nested
 +
    --></tr><!--
  
// 3rd column is main statement text. Uses a nested table to allow for row-by-row variable col. width
+
ADDITIONAL info below the statement/result line:
--><td class="lead-row1" {{#if: {{{parentlead}}}||colspan="3"}}><!--
+
ERROR REPORTING: Any content in 4th and later unnamed parameters is an error.
  --><table class="nested" width="100%" cellspacing="0" cellpadding="0"><tr><!--
+
-->{{#if: {{{errors}}}<!--  
    --><td class="leadtxt {{#if:{{{next}}}|leadon}}" width="95%"><!--
+
-->|<tr><th colspan="2" class="leaderror">{{{errors}}}</th></tr><!--
    --><span class="leadspan">{{Trim|1={{{statement}}}}}&nbsp;</span><!--
+
-->}}<!--
    // Add mw-collapsible span (the "more…")
+
    -->{{#if: {{{detailspresent}}}|<span class="leadspan noprint mw-customtoggle-{{{leadID}}}_{{#var:decisiontreeAlternative}}row"></span>}}<!--
+
    --></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)!
+
    // 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}}}|<td class="leadresult leadon"><span class="leadon">&nbsp;[[#L{{{keyID}}}_{{{parentlead}}}{{{next}}}|&nbsp;►{{
+
      #if:{{{resulttext}}}|►}}&nbsp;{{{next}}}]]</span>|<td>
+
    }}</td>{{
+
    #if:{{{resulttext}}}{{{nested}}}<!--
+
    // THEN New-Row-For-Results. Leaderdots for next, but not if also result is present!
+
    -->|</tr><tr><!--
+
    --><td class="leadresult {{#if: {{{next}}} |{{#if: {{{resulttext}}}{{{commonnames}}} | |leadon}}}}" colspan="2"><!--
+
  
    // BACKGROUND OLD/NEW RESULTSTYLE:
+
  START EXTRA INFO and IMAGES:
    // The original ("old") layout interprets result as either free of scientific name
+
  Extra text and images from the optional parameters: "synonyms", "description",
    //   (and it does not know which is which), and adds the common name in front.
+
   "occurrence", "remarks" are already combined to detailtext here. "image
    // The new format should be able to either show free-form result text (common/scientific
+
  m/caption m" to "image r/caption r" are tested. For wrappable gallery images are
    //  name may be present, but are not shown) or directly common and scientific name.
+
  below detailtext
    // See also schema at bottom of Template:Lead/doc
+
-->{{#if: {{{detailtext}}}{{{image m}}}<!--
    // TODO: introduce resultformat parameter later (= list of format options, allowing common name or scientific name to be first)
+
-->|<tr><td class="leadextras" colspan="2"><div class="leadextras">{{{detailtext}}}<!--
    -->{{#if: {{{resulttextoverride}}}<!--  
+
-->{{#if: {{{image m}}}<!--
      -->|{{#if: {{{scientificname}}}|<!--
+
       At least 1 extra image present, after extra text or alone: START Secondary-IMAGE CONTENT
       // THEN: NEW LAYOUT RULES -> ignore commonnames+scientificname if resulttextoverride
+
       The wrapping table around float-left tables is necessary, with nothing or a div
       // ELSE:-> output common names even for resulttextoverride
+
       the outer div will not be around, and the lines not displayed
       -->|{{#if: {{{commonnames}}}<!--
+
THEN-->|<table><tr><td><!--
        -->|<span class="commonnames">&nbsp;{{Lead/MakeCommaBreakingList | listtext={{{commonnames}}} }}&nbsp;&ndash;</span><!-- (no additional space after ndash!)
+
      -->{{#if: {{{image m}}}|{{Lead/GalleryItem|image={{{image m}}}|caption={{{caption m}}}|label={{{label m}}}|width={{Pixel2Number|{{{image m width}}}}}|height={{Pixel2Number|{{{image m height}}}}}|lines={{{captionlines}}}}}<!-- -->}}<!--
        -->}}<!--
+
      -->{{#if: {{{image n}}}|{{Lead/GalleryItem|image={{{image n}}}|caption={{{caption n}}}|label={{{label n}}}|width={{Pixel2Number|{{{image n width}}}}}|height={{Pixel2Number|{{{image n height}}}}}|lines={{{captionlines}}}}}<!-- -->}}<!--
      -->}}<!-- // END scientificname
+
      -->{{#if: {{{image o}}}|{{Lead/GalleryItem|image={{{image o}}}|caption={{{caption o}}}|label={{{label o}}}|width={{Pixel2Number|{{{image o width}}}}}|height={{Pixel2Number|{{{image o height}}}}}|lines={{{captionlines}}}}}<!-- -->}}<!--
    // ELSE: no resulttextoverride, output commonnames for both OLD and NEW LAYOUT
+
       -->{{#if: {{{image p}}}|{{Lead/GalleryItem|image={{{image p}}}|caption={{{caption p}}}|label={{{label p}}}|width={{Pixel2Number|{{{image p width}}}}}|height={{Pixel2Number|{{{image p height}}}}}|lines={{{captionlines}}}}}<!-- -->}}<!--
       -->|{{#if: {{{commonnames}}}<!--
+
      -->{{#if: {{{image q}}}|{{Lead/GalleryItem|image={{{image q}}}|caption={{{caption q}}}|label={{{label q}}}|width={{Pixel2Number|{{{image q width}}}}}|height={{Pixel2Number|{{{image q height}}}}}|lines={{{captionlines}}}}}<!-- -->}}<!--
        -->|<span class="commonnames">&nbsp;{{Lead/MakeCommaBreakingList | listtext={{{commonnames}}} }}&nbsp;&ndash;</span><!--  
+
      -->{{#if: {{{image r}}}|{{Lead/GalleryItem|image={{{image r}}}|caption={{{caption r}}}|label={{{label r}}}|width={{Pixel2Number|{{{image r width}}}}}|height={{Pixel2Number|{{{image r height}}}}}|lines={{{captionlines}}}}}<!-- -->}}<!--
        // (no additional space after ndash!)
+
      --></td></tr><!--
        // DEBUG: ABOVE WAS: {{#if: {{{resulttext}}} |&nbsp;&ndash;|&#32;}}</span> // OK WITHOUT?
+
      -->{{#if:{{{imagesfooter}}}<!--
 +
        -->|<tr><td colspan="10" style="text-align:right; font-size:80%; line-height:1em;">{{{imagesfooter}}}</td></tr><!--
 
       -->}}<!--
 
       -->}}<!--
     // END resulttextoverride:
+
     --></table><!--
    -->}}<!-- // END NEW/OLD LAYOUT, result itself is identical
+
-->}}<!-- END any image
 +
--></div></td></tr><!--
 +
-->}}<!-- END detailtext or image m in a second
 +
--></table><!-- END of "nested" inner table --><!--
  
    // resulttext = one of resulttextoverride, scientificname, or resultlink itself.
+
  At least one larger, non-hide-able image below (image j/k):
    // 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="leadout {{#ifexpr:{{#len:{{{resulttext}}} }} < 40|nowrap}}">&nbsp;&nbsp;{{
+
    #ifeq: {{#sub: {{{resultlink}}}|0|5}}|http:<!--
+
    // THEN http-link:
+
    -->|[{{{resultlink}}} {{{resulttext}}}]<!--
+
    // ELSE wiki link or result-text-only (non-link).
+
    -->|{{#if: {{{resultlink}}}<!--
+
      // THEN
+
        -->|[[{{{resultlink}}}|{{{resulttext}}}]]<!--
+
      // ELSE unlinked
+
        -->|{{{resulttext}}}<!--
+
      // END resultlink
+
      -->}}<!--
+
    // END (if http-link)
+
    -->}}</span><!-- close span.leadout. span.leadresults will be closed after result qualifier!
+
 
+
    // resultqualifier in all result-layout variants
+
    -->{{#if: {{{resultqualifier}}}<!--
+
      // THEN (start with wrappable blank, NOT a br-if-image-sidebar present: res.qual. may just be "L.")
+
      -->|<nowiki></nowiki> <span class="resultqualifier {{#ifexpr:{{#len:{{{resultqualifier}}} }} < 40|nowrap}}"> {{{resultqualifier}}}</span><!--
+
    // END (res.qual.), + closing span.leadresults (= nowrap-span around result+qualif.)
+
    -->}}</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><!--
+
 
+
  // END New-Row-For-Results
+
  -->}}</tr><!--
+
 
+
// PART 4. ADDITIONAL = error, detailtext, image gallery m-r
+
// 4 a) ERROR REPORTING: Any content in 4th and later unnamed parameters is an error.
+
-->{{#if: {{{errors}}}<!--
+
-->|<tr><td class="leaderror" colspan="2">{{{errors}}}</td></tr><!--
+
-->}}<!--
+
// 4 b) START EXTRA INFO and IMAGES:
+
// Extra text and images from the optional parameters: detailtext = synonyms + description +
+
// occurrence + remarks; already combined in outer Lead template!
+
// Wrappable gallery image m/caption m" to "image r/caption r" output below detailtext
+
-->{{#if: {{{detailspresent}}}<!--
+
// THEN
+
-->|<tr><td class="leadextras" colspan="2"><!--
+
--><div class="mw-collapsible mw-collapsed mw-collapsible-content leadextras" id="mw-customcollapsible-{{{leadID}}}_{{#var:decisiontreeAlternative}}row"><!--
+
-->{{{detailtext}}}<!--
+
-->{{#if: {{{image m}}}<!--
+
// THEN at least 1 extra image present, after detailtext or alone:
+
  // 4 c: START Secondary-IMAGE-Gallery
+
  // The nested wrapping table around left-floating tables is necessary, without or with a div
+
  // the images will not be contained in the outer div and the lines not displayed
+
  -->|<table><tr><td>{{
+
  #if: {{{image m}}}|{{Lead/GalleryItem|image={{{image m}}}|caption={{{caption m}}}|label={{{label m}}}|width={{Pixel2Number|{{{image m width}}}}}|height={{Pixel2Number|{{{image m height}}}}}|lines={{{captionlines}}}}}}}{{
+
  #if: {{{image n}}}|{{Lead/GalleryItem|image={{{image n}}}|caption={{{caption n}}}|label={{{label n}}}|width={{Pixel2Number|{{{image n width}}}}}|height={{Pixel2Number|{{{image n height}}}}}|lines={{{captionlines}}}}}}}{{
+
  #if: {{{image o}}}|{{Lead/GalleryItem|image={{{image o}}}|caption={{{caption o}}}|label={{{label o}}}|width={{Pixel2Number|{{{image o width}}}}}|height={{Pixel2Number|{{{image o height}}}}}|lines={{{captionlines}}}}}}}{{
+
  #if: {{{image p}}}|{{Lead/GalleryItem|image={{{image p}}}|caption={{{caption p}}}|label={{{label p}}}|width={{Pixel2Number|{{{image p width}}}}}|height={{Pixel2Number|{{{image p height}}}}}|lines={{{captionlines}}}}}}}{{
+
  #if: {{{image q}}}|{{Lead/GalleryItem|image={{{image q}}}|caption={{{caption q}}}|label={{{label q}}}|width={{Pixel2Number|{{{image q width}}}}}|height={{Pixel2Number|{{{image q height}}}}}|lines={{{captionlines}}}}}}}{{
+
  #if: {{{image r}}}|{{Lead/GalleryItem|image={{{image r}}}|caption={{{caption r}}}|label={{{label r}}}|width={{Pixel2Number|{{{image r width}}}}}|height={{Pixel2Number|{{{image r height}}}}}|lines={{{captionlines}}}}}}}<!--
+
  --></td></tr><!--
+
  -->{{#if:{{{imagesfooter}}}<!--
+
    -->|<tr><td colspan="10" style="text-align:right; font-size:80%; line-height:1em;">{{{imagesfooter}}}</td></tr><!--
+
  -->}}<!--
+
  --></table><!--
+
// END 4 c: END Secondary-IMAGE-Gallery
+
-->}}</div></td></tr><!-- div = end mw-collapsible
+
// END 4. ADDITIONAL error, detailtext or image gallery (m-r)
+
-->}}<!--
+
// END of "nested" inner table
+
--></table><!--
+
  
// PART 5: Large, always-visibly image j/k (not collapsed) below lead statement and result:
 
 
-->{{#if:{{{image j}}}{{{image k}}}<!--
 
-->{{#if:{{{image j}}}{{{image k}}}<!--
-->|<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]]<!--
+
   -->|<!--
     -->{{#if: {{{label j}}}|'''{{{label j}}}: '''}}{{{caption 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]]<!--  
 +
     -->{{#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]]<!--
+
   -->|<!--
     -->{{#if: {{{label k}}}|'''{{{label k}}}: '''}}{{{caption 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]]<!--  
 +
     -->{{#if: {{{label k}}}|'''{{{label k}}}: '''}}{{{caption k}}}<!--  
 
     --></div><!--
 
     --></div><!--
 
-->}}<!--
 
-->}}<!--
   --></td></tr><!--
+
   --></td></tr><!--  
--></table><!--
+
--></table><!-- end always-on image below:
// END PART 5: Always-on images (image j/k)
+
-->}}<!--  
-->}}<!--
+
--></td><td><!--  
--></td><td><!--
+
 
 +
  At least 1 sidebar image present (else empty td created):
  
// PART 6: Right Sidebar Images
+
-->{{#if: {{{image a}}}<!--  
-->{{#if: {{{image a}}}<!-- at least 1st present (else empty td created):
+
    START RIGHT SIDEBAR IMAGE CONTENT, (image m... in contrast are hidden by default)
// Up to 5 images, non-wrapping, always visible but smaller than image m-r
+
    up to 5 images, non-wrapping, Lead/GalleryItemNoCaption creates td!
// → image a-e,  caption a-e, image a-e width, primary images width and image
+
    → image a - e,  caption a - e, image a - e width, primary images width and image
// a-e height, primary images height (both for all images)
+
    a - e height, primary images height (both for all images)
// Lead/GalleryItemNoCaption creates td!
+
THEN-->|<table style="border:none; margin-top:0.1em;margin-left:1em;"><!--
THEN-->|<table style="border:none; margin-top:0.1em;margin-left:1em;"><tr>{{
+
      --><tr><!--
#if: {{{image a}}}|{{Lead/GalleryItemNoCaption|image={{{image a}}}|caption={{{caption a}}}|label={{{label a}}}|width={{Pixel2Number|{{{image a width}}}}}|height={{Pixel2Number|{{{image a height}}}}}}}}}{{
+
      -->{{#if: {{{image a}}}|{{Lead/GalleryItemNoCaption|image={{{image a}}}|caption={{{caption a}}}|label={{{label a}}}|width={{Pixel2Number|{{{image a width}}}}}|height={{Pixel2Number|{{{image a height}}}}}}}<!-- -->}}<!--
#if: {{{image b}}}|{{Lead/GalleryItemNoCaption|image={{{image b}}}|caption={{{caption b}}}|label={{{label b}}}|width={{Pixel2Number|{{{image b width}}}}}|height={{Pixel2Number|{{{image b height}}}}}}}}}{{
+
      -->{{#if: {{{image b}}}|{{Lead/GalleryItemNoCaption|image={{{image b}}}|caption={{{caption b}}}|label={{{label b}}}|width={{Pixel2Number|{{{image b width}}}}}|height={{Pixel2Number|{{{image b height}}}}}}}<!-- -->}}<!--
#if: {{{image c}}}|{{Lead/GalleryItemNoCaption|image={{{image c}}}|caption={{{caption c}}}|label={{{label c}}}|width={{Pixel2Number|{{{image c width}}}}}|height={{Pixel2Number|{{{image c height}}}}}}}}}{{
+
      -->{{#if: {{{image c}}}|{{Lead/GalleryItemNoCaption|image={{{image c}}}|caption={{{caption c}}}|label={{{label c}}}|width={{Pixel2Number|{{{image c width}}}}}|height={{Pixel2Number|{{{image c height}}}}}}}<!-- -->}}<!--
#if: {{{image d}}}|{{Lead/GalleryItemNoCaption|image={{{image d}}}|caption={{{caption d}}}|label={{{label d}}}|width={{Pixel2Number|{{{image d width}}}}}|height={{Pixel2Number|{{{image d height}}}}}}}}}{{
+
      -->{{#if: {{{image d}}}|{{Lead/GalleryItemNoCaption|image={{{image d}}}|caption={{{caption d}}}|label={{{label d}}}|width={{Pixel2Number|{{{image d width}}}}}|height={{Pixel2Number|{{{image d height}}}}}}}<!-- -->}}<!--
#if: {{{image e}}}|{{Lead/GalleryItemNoCaption|image={{{image e}}}|caption={{{caption e}}}|label={{{label e}}}|width={{Pixel2Number|{{{image e width}}}}}|height={{Pixel2Number|{{{image e height}}}}}}}}}<!--
+
      -->{{#if: {{{image e}}}|{{Lead/GalleryItemNoCaption|image={{{image e}}}|caption={{{caption e}}}|label={{{label e}}}|width={{Pixel2Number|{{{image e width}}}}}|height={{Pixel2Number|{{{image e height}}}}}}}<!-- -->}}<!--
--></tr></table><!--
+
      --></tr><!--  
// END PART 6: Right Sidebar Images
+
    --></table>
-->}}</td></tr></includeonly>
+
}}</td></tr></includeonly>

Version vom 9. September 2012, 08:57 Uhr

Version 3.7.

NEW: length estimate based on resulttext instead of resultlink (for empty result!!!)

Previous changes:
a) nested works now on parents with backlinks and alternatives (1 and 1*, 1 and 1'). 1 and 1- NEEDS TESTING!
b) result text+ empty result supported (non-linking result).
d) nowrap on result/qualifier reworked!
d) result=http:... now works.
e) Nested subkey ok. Resultqualifier no longer in ()

See Key Start for the main documentation.

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