Szablon:Ekskluzywne: Różnice pomiędzy wersjami
| [wersja nieprzejrzana] | [wersja przejrzana] |
poprawki |
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 | ||
category name of the category for edition-only specifics | |||
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 | ||
(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}}<!-- | ||
-- 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}} }} | ||
| java = | |||
{{#vardefine: edition | Java Edition}} | {{#vardefine: edition | Java Edition}} | ||
{{#vardefine: linkname | Java Edition}} | {{#vardefine: linkname | Java Edition}} | ||
| bedrock = | |||
{{#vardefine: edition | Bedrock Edition}} | {{#vardefine: edition | Bedrock Edition}} | ||
{{#vardefine: linkname | Bedrock Edition}} | {{#vardefine: linkname | Bedrock Edition}} | ||
| console | legacy console = | |||
{{#vardefine: edition | Console Edition}} | |||
{{#vardefine: linkname | Console Edition}} | |||
{{#vardefine: edition |Console Edition}} | | ps4 | playstation 4 = | ||
{{#vardefine: linkname |Console Edition}} | {{#vardefine: edition | PlayStation 4 Edition}} | ||
{{#vardefine: | {{#vardefine: linkname | PlayStation 4 Edition}} | ||
{{#vardefine: | | education | edu = | ||
| education = | |||
{{#vardefine: edition | Education Edition}} | {{#vardefine: edition | Education Edition}} | ||
{{#vardefine: linkname | Education Edition}} | {{#vardefine: linkname | Education Edition}} | ||
{{#vardefine: | | new3ds | new 3ds | 3ds = | ||
{{#vardefine: | {{#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}} }} | ||
}} <!-- | }} <!-- | ||
-- 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: 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: edition}}]] | }} {{#var: edition}}]] | ||
}} | }} | ||
}}<!-- | |||
}} <!-- | |||
-- 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= | | title = {{#if: {{{customtext|}}} | {{{customtext}}} | Ten element dotyczy wyłącznie {{#var: editions}}.}} | ||
| | | css = display: table; | ||
| | | image = {{{image|Information icon.svg}}} | ||
}} | | mini = {{{section|}}} | ||
}}<!-- | |||
--> </includeonly> <!-- | --></includeonly><noinclude>{{Dokumentacja}} | ||
--> | <!-- Put categories/interwiki on the documentation page --> | ||
</noinclude> | |||
Aktualna wersja na dzień 20:48, 5 wrz 2021
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[edytuj kod]
Anonimowe parametry[edytuj kod]
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[edytuj kod]
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[edytuj kod]
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 |