m (naimportována 1 revize: Import EN templates) |
Bez shrnutí editace |
||
Řádek 1: | Řádek 1: | ||
+ | <includeonly><!-- |
||
− | <div style=" |
||
+ | |||
− | border: 2px solid #95D1E9; |
||
+ | Local variables used in the argument processing loop: |
||
− | background-color: #E6F3F7; |
||
+ | argnum index for accessing template call arguments |
||
− | text-align: center; |
||
+ | argval value of indexed template call argument |
||
− | margin: 0 auto 1em; |
||
+ | edition name of the edition as used on the wiki; obsolescent argument values are upgraded here |
||
− | padding: 10px 10px 2px; |
||
+ | linkname name of the edition's article page for linking |
||
− | width: 300px; |
||
+ | category name of the category for edition-only specifics |
||
− | height: {{#if: {{#pos:{{lc:{{{1}}} {{{2}}} {{{3}}} }}|education}}|90px|75px}}; |
||
+ | Output variables used by the template expansion: |
||
− | position: relative; |
||
+ | editions comma-separated list of edition names |
||
− | ">{{animate|{{ |
||
+ | categories list of bracketed category names separated by spaces |
||
⚫ | |||
+ | |||
− | |java=mclogo.svg |
||
+ | (Re-)Initialize output variables in case the template is used multiple times on a page |
||
− | |{{ucfirst:{{{1|java}}}}} Edition.png |
||
+ | --> {{#vardefine: editions}} <!-- |
||
− | }}{{ |
||
+ | --> {{#vardefine: categories}} <!-- |
||
− | |||
+ | |||
⚫ | |||
+ | -- Process the arguments -- |
||
− | |;{{ |
||
+ | --> {{#fornumargs: argnum | argval | |
||
− | #switch: {{lc:{{{2}}}}} |
||
+ | <!-- set local variable values per argument keyword; replace obsolescent edition names --> |
||
− | |java=mclogo.svg |
||
⚫ | |||
− | |{{ucfirst:{{{2}}}}} Edition.png |
||
+ | | java = |
||
− | }} |
||
+ | {{#vardefine: edition | Java Edition}} |
||
− | }}{{ |
||
+ | {{#vardefine: linkname | Java Edition}} |
||
− | |||
+ | {{#vardefine: category | Java Edition}} |
||
− | #if: {{{3|}}} |
||
+ | | bedrock = |
||
− | |;{{ |
||
+ | {{#vardefine: edition | Bedrock Edition}} |
||
− | #switch: {{lc:{{{3}}}}} |
||
+ | {{#vardefine: linkname | Bedrock Edition}} |
||
− | |java=mclogo.svg |
||
+ | {{#vardefine: category | Bedrock Edition}} |
||
− | |{{ucfirst:{{{3}}}}} Edition.png |
||
+ | | console | legacy console = |
||
− | }} |
||
+ | {{#vardefine: edition | Legacy Console Edition}} |
||
− | }}|250px}} |
||
+ | {{#vardefine: linkname | Legacy Console Edition}} |
||
− | <div style=" |
||
+ | {{#vardefine: category | Legacy Console Edition}} |
||
− | position: absolute; |
||
+ | | ps4 | playstation 4 = |
||
− | bottom: 0; |
||
+ | {{#vardefine: edition | PlayStation 4 Edition}} |
||
− | left: 0; |
||
+ | {{#vardefine: linkname | PlayStation 4 Edition}} |
||
− | right: 0; |
||
+ | {{#vardefine: category | PlayStation 4 Edition}} |
||
− | "><br/><hr/>'''{{ |
||
+ | | education | edu = |
||
− | #if: {{{3|}}} |
||
+ | {{#vardefine: edition | Education Edition}} |
||
− | |[[{{ucfirst:{{{1|java}}}}} Edition|{{ucfirst:{{{1|java}}}}}]], [[{{ucfirst:{{{2}}}}} Edition|{{ucfirst:{{{2}}}}}]] & [[{{ucfirst:{{{3}}}}} Edition]]s only''' |
||
+ | {{#vardefine: linkname | Education Edition}} |
||
− | |[[{{ucfirst:{{{1|java}}}}} Edition]] {{ |
||
+ | {{#vardefine: category | Education Edition}} |
||
− | #if: {{{2|}}} |& [[{{ucfirst:{{{2}}}}} Edition]] |
||
+ | | new3ds | new 3ds | 3ds = |
||
− | }} only''' |
||
+ | {{#vardefine: edition | New Nintendo 3DS Edition}} |
||
− | }}</div></div><includeonly>{{ |
||
+ | {{#vardefine: linkname | New Nintendo 3DS Edition}} |
||
− | #if: {{{nocat|}}} |
||
+ | {{#vardefine: category | New Nintendo 3DS Edition}} |
||
⚫ | |||
+ | | #default = |
||
− | |{{ |
||
+ | {{#vardefine: edition | {{ucfirst:{{#var: argval}} Edition}} }} |
||
⚫ | |||
+ | {{#vardefine: linkname | {{#var: edition}} }} |
||
⚫ | |||
+ | {{#vardefine: category | {{#var: edition}}}} |
||
− | | #default = [[Category:{{{1|java}}} Edition only]] {{ |
||
+ | }} <!-- |
||
− | #if:{{{2|}}} | [[Category:{{{2}}} Edition only]] }}{{ |
||
+ | |||
− | #if:{{{3|}}} | [[Category:{{{3}}} Edition only]] }} |
||
+ | -- Append values to output variables, inserting punctuation and wiki markup where needed |
||
− | }} |
||
+ | --> {{#vardefine: editions | |
||
⚫ | |||
+ | {{#if: {{#var: editions|}} <!-- not the 1st edition arg --> |
||
+ | | {{#if: {{{ {{#expr: {{#var: argnum}} + 1}}| }}} <!-- not the last edition arg --> |
||
+ | | {{#var: editions}}, |
||
+ | | {{#var: editions}} and |
||
+ | }} |
||
+ | }} [[{{#ifeq: {{#var: linkname}} | {{#var: edition}} |
||
+ | | |
||
+ | | {{#var: linkname}} {{!}} |
||
+ | }} {{#var: edition}}]] |
||
+ | }} |
||
+ | {{#vardefine: categories | {{#var: categories}} [[Category: {{#var: category}}]] }} |
||
+ | }} <!-- |
||
+ | |||
+ | -- Generate the msgbox, adding HTML and CSS styling where needed |
||
+ | --> {{msgbox | bgcol=#e6f3f7 | linecol=#95d1e9 |
||
+ | | title = {{#if: {{{customtext|}}} | {{{customtext}}} | This feature is exclusive to {{#var: editions}}.}} |
||
+ | | css = display: table; |
||
+ | | image = {{{image|Information icon.svg}}} |
||
+ | | mini = {{{section|}}} |
||
+ | }} <!-- |
||
+ | |||
+ | -- Add categories for edition-only information |
||
⚫ | |||
⚫ | |||
⚫ | |||
+ | | {{TALKSPACE}} | {{ns:User}} = |
||
⚫ | |||
+ | | {{#var: categories}} {{#if: {{{customtext|}}} | [[Category:Pages using the Exclusive template customtext parameter]]}} |
||
+ | }} |
||
+ | }} <!-- |
||
+ | --> </includeonly> <!-- |
||
⚫ | |||
+ | <!-- Put categories/interwiki on the documentation page --> |
Verze z 3. 7. 2019, 17:27
This template is used to mark features exclusive to a version or specific versions of Minecraft.
Usage
{{{1}}}
- First version, defaults toJava
{{{2}}}
- Second version. Unused if unset{{{3}}}
- Third version. Unused if unset{{{nocat}}}
- If set, no categories will be added.
Categories
Pages will automatically be added to a category based on what either version is set to unless {{{nocat}}}
is set. Specific categories produced are as follows:
java
: Category:Java Edition onlypocket
: Category:Pocket Edition onlyconsole
: Category:Console Edition onlyeducation
: Category:Education Edition only
Example
{{exclusive}}
- OR
{{exclusive|java}}
Produces
This feature is exclusive to Java Edition.
Example
{{exclusive|pocket|console}}
Produces
Example
{{exclusive|java|pocket|console}}
Produces
[view | edit | history | purge]The above documentation is transcluded from Šablona:Exclusive/doc.