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

Z Minecraft Wiki Polska
Przejdź do nawigacji Przejdź do wyszukiwania
[wersja nieprzejrzana][wersja przejrzana]
poprawki
KsawiBOT (dyskusja | edycje)
d standaryzacja szablonu dokumentacji
 
(Nie pokazano 8 wersji utworzonych przez 4 użytkowników)
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 --
--> {{#fornumargs: argnum | argval |
-->{{#fornumargs: argnum | argval |
         <!-- 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 | Nintendo 3DS Edition}}
                {{#vardefine: linkname | Nintendo 3DS Edition}}
            | earth | earth | earth =
                 {{#vardefine: edition | Minecraft Earth}}
                 {{#vardefine: linkname | Minecraft Earth}}
             | #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 63: Linia 51:
                     }}
                     }}
                 }} [[{{#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.svg}}}
         }} <!--
         | mini = {{{section|}}}
<!--
         }}<!--
--> </includeonly> <!--
--></includeonly><noinclude>{{Dokumentacja}}
--> <noinclude> {{/doc}} </noinclude> <!--
<!-- Put categories/interwiki on the documentation page -->
</noinclude>

Aktualna wersja na dzień 20:48, 5 wrz 2021

[ podgląd | edytuj | historia | odśwież ]Dokumentacja


Ten szablon jest używany do oznaczania elementów występujących wyłącznie w konkretnej edycji lub edycjach Minecraft. Wyszczególnia edycje określone przez parametry w oknie komunikatu, wyśrodkowane nad stroną lub na lewym marginesie nad sekcją.

Parametry

Anonimowe parametry

Szablon akceptuje dowolną liczbę anonimowych parametrów, po jednym dla każdej wersji, która ma tę funkcję. Znane wartości parametrów automatycznie wybierają nazwę powiązanej edycji i nazwę strony. Jeśli napotkana zostanie nieznana wartość parametru, wartości domyślne są generowane przez formułę (i mogą powodować powstawanie czerwonych linków, które mogą być zamierzone lub nie).

Wartość parametru Nazwa edycji Linkowana strona
bedrock Bedrock Edition Bedrock Edition
java Java Edition Java Edition
console
legacy console
Console Edition Console Edition
playstation 4
ps4
PlayStation 4 Edition PlayStation 4 Edition
education
edu
Education Edition Education Edition
new 3DS
new3DS
3DS
Nintendo 3DS Edition Nintendo 3DS Edition
earth Minecraft Earth Minecraft Earth
(unknown) <param> Edition [[<param> Edition]]

Nazwane parametry

Oprócz parametrów anonimowych szablon akceptuje następujące nazwane parametry:

Parametr Efekt
section=1 Zmienia styl msgbox na bardziej odpowiedni dla sekcji artykułu. Umieść to po nagłówku sekcji.
customtext=własny tekst Zamienia tekst z msg boxu na własny.

Przyłady

Poniższe przykłady przedstawiają działanie szablonu z poszczególnymi parametrami.

Przykład 1 - Pojedyncza nazwa edycji
{{Ekskluzywne|java}}

generuje:

Ten element dotyczy wyłącznie Java Edition.


Przykład 2 - Kilka edycji
{{Eksluzywne|bedrock|education|ps4}}

generuje:

Ten element dotyczy wyłącznie Bedrock Edition, Education Edition i PlayStation 4 Edition.


Przykład 3 - Wykorzystanie w sekcji
{{Ekskluzywne|3ds|section=1}}

generuje:

Ten element dotyczy wyłącznie Nintendo 3DS Edition.


Przykład 4 - Parametr Customtext
{{Ekskluzywne|console|customtext=Ten element występował jedynie w [[Console Edition]]}}

generuje:

Ten element występował jedynie w Console Edition