Szablon:Ekskluzywne: Różnice pomiędzy wersjami

Z Minecraft Wiki Polska
Przejdź do nawigacji Przejdź do wyszukiwania
[wersja nieprzejrzana][wersja nieprzejrzana]
Zmiana zdjęcia
akt. szablonu
Linia 6: Linia 6:
   edition          name of the edition as used on the wiki; obsolescent argument values are upgraded here
   edition          name of the edition as used on the wiki; obsolescent argument values are upgraded here
   linkname          name of the edition's article page for linking
   linkname          name of the edition's article page for linking
   image            name of the edition's logo image file
   category          name of the category for edition-only specifics
  imgboxheight      value for the "height" property of the image box
Output variables used by the template expansion:
Output variables used by the template expansion:
   editions          comma-separated list of edition names
   editions          comma-separated list of edition names
  images            semicolon-separated list of image file names
  maximgboxheight  maximum height of the image box


(Re-)Initialize output variables in case the template is used multiple times on a page
(Re-)Initialize output variables in case the template is used multiple times on a page
--> {{#vardefine: editions}}                                <!--
--> {{#vardefine: editions}}                                <!--
--> {{#vardefine: images}}                                  <!--
-->                             <!--
--> {{#vardefine: categories}}                              <!--         
--> {{#vardefine: maximgboxheight | {{{logoheight|50}}} }}  <!--


-- Process the arguments --
-- Process the arguments --
Linia 23: Linia 18:
         <!-- set local variable values per argument keyword; replace obsolescent edition names -->
         <!-- set local variable values per argument keyword; replace obsolescent edition names -->
         {{#switch: {{lc:{{#var: argval}} }}  
         {{#switch: {{lc:{{#var: argval}} }}  
             | computer | pc | java =  
             | java =  
                 {{#vardefine: edition | Java Edition}}
                 {{#vardefine: edition | Java Edition}}
                 {{#vardefine: linkname | Java Edition}}
                 {{#vardefine: linkname | Java Edition}}
                {{#vardefine: image | Java Edition.png}}
             | bedrock =  
                {{#vardefine: imgboxheight | 50}}
             | pocket | bedrock =  
                 {{#vardefine: edition | Bedrock Edition}}
                 {{#vardefine: edition | Bedrock Edition}}
                 {{#vardefine: linkname | Bedrock Edition}}
                 {{#vardefine: linkname | Bedrock Edition}}
                {{#vardefine: image | MClogo.svg}}
            | console | legacy console =  
                {{#vardefine: imgboxheight | 50}}
                 {{#vardefine: edition | Console Edition}}
            | console =  
                 {{#vardefine: linkname | Console Edition}}
                 {{#vardefine: edition |Console Edition}}
            | ps4 | playstation 4 =
                 {{#vardefine: linkname |Console Edition}}
                 {{#vardefine: edition | PlayStation 4 Edition}}
                 {{#vardefine: image |Console Edition.png}}
                 {{#vardefine: linkname | PlayStation 4 Edition}}
                 {{#vardefine: imgboxheight | 50}}
             | education | edu =
             | education =
                 {{#vardefine: edition | Education Edition}}
                 {{#vardefine: edition | Education Edition}}
                 {{#vardefine: linkname | Education Edition}}
                 {{#vardefine: linkname | Education Edition}}
                {{#vardefine: image | EducationEditionLogo.png}}
            | new3ds | new 3ds | 3ds =
                {{#vardefine: imgboxheight | 65}}   
                 {{#vardefine: edition | New Nintendo 3DS Edition}}
            | 3ds =
                 {{#vardefine: linkname | New Nintendo 3DS Edition}}
                 {{#vardefine: edition | Nintendo 3DS Edition}}
                 {{#vardefine: linkname | Nintendo 3DS Edition}}
                {{#vardefine: image | New Nintendo 3DS Edition.png}}
                {{#vardefine: imgboxheight | 50}}  
             | #default =  
             | #default =  
                 {{#vardefine: edition | {{ucfirst:{{#var: argval}} Edition}} }}
                 {{#vardefine: edition | {{ucfirst:{{#var: argval}} Edition}} }}
                 {{#vardefine: linkname | {{#var: edition}} }}
                 {{#vardefine: linkname | {{#var: edition}} }}
                {{#vardefine: image | {{#var: edition}}.png }}
                {{#vardefine: imgboxheight | 50}}
             }} <!--  
             }} <!--  


         -- Append values to output variables, inserting punctuation and wiki markup where needed
         -- Append values to output variables, inserting punctuation and wiki markup where needed
-->    {{#vardefine: images |
-->    {{#vardefine: editions |
            {{#if: {{#var: images|}}
                | {{#var: images}};
                }} {{#var: image}}
            }}
        {{#vardefine: editions |
             {{#if: {{#var: editions|}} <!-- not the 1st edition arg -->
             {{#if: {{#var: editions|}} <!-- not the 1st edition arg -->
                 | {{#if: {{{ {{#expr: {{#var: argnum}} + 1}}| }}} <!-- not the last edition arg -->
                 | {{#if: {{{ {{#expr: {{#var: argnum}} + 1}}| }}} <!-- not the last edition arg -->
Linia 68: Linia 49:
                     }}
                     }}
                 }} [[{{#ifeq: {{#var: linkname}} | {{#var: edition}}  
                 }} [[{{#ifeq: {{#var: linkname}} | {{#var: edition}}  
                     |  
                     |  
                     | {{#var: linkname}} {{!}}  
                     | {{#var: linkname}} {{!}}
                     }} {{#var: edition}}]]
                     }} {{#var: edition}}]]
            }}
        {{#vardefine: maximgboxheight |
            {{#ifexpr: {{#var: imgboxheight}} > {{#var: maximgboxheight}}
                | {{#var: imgboxheight}}
                | {{#var: maximgboxheight}}
                }}
             }}
             }}
         }} <!--
         }} <!--


-- Generate the msgbox, adding HTML and CSS styling where needed
-- Generate the msgbox, adding HTML and CSS styling where needed
--> {{msgbox | bgcol=#e6f3f7 | linecol=#95d1e9  
--> {{msgbox | bgcol=#e6f3f7 | linecol=#95d1e9
         | title=<div style="height: {{#var: maximgboxheight}}px">{{animate|{{#var: images}}|250px}}</div>
         | title = {{#if: {{{customtext|}}} | {{{customtext}}} | Ten element dotyczy wyłącznie {{#var: editions}}.}}
         | text=<hr/>'''Tylko {{#var: editions}}'''
         | css = display: table;
         | css=min-width: 350px; padding-top: 10px;
        | image = {{{image|Information icon.png}}}
         | mini = {{{section|}}}
        }}
         }} <!--
         }} <!--
<!--
--> </includeonly> <!--
--> </includeonly> <!--
--> <noinclude> {{/doc}} </noinclude> <!--
--> <noinclude> {{doc}} </noinclude> <!--
<!-- Put categories/interwiki on the documentation page -->

Wersja z 15:46, 3 lip 2019