Template:Test: Difference between revisions

From A KoL Wiki
imported>Pastrywoman
mNo edit summary
imported>Philmasterplus
No edit summary
Line 1: Line 1:
<includeonly>|- id="{{{aname|player-id-{{{id|{{{1|0}}}}}}}}}"
<includeonly>{{
| {{{name|{{{2|<Player's Name Unknown>}}}}}} || {{{id|{{{1}}}}}} || {{#ifexpr: {{{avatarcount|{{{3|1}}}}}} > 0 | {{{avatar1|{{{4|[[File:{{{id|{{{1|0}}}}}}.gif|{{{name|{{{2|<Player's Name Unknown>}}}}}}'s Avatar]]}}}}}}}} {{#ifexpr: {{{avatarcount|{{{3|1}}}}}} > 1 | {{{avatar2|{{{5|[[File:{{{id|{{{1|0}}}}}}_2.gif|{{{name|{{{2|<Player's Name Unknown>}}}}}}'s 2nd Avatar]]}}}}}}}} {{#ifexpr: {{{avatarcount|{{{3|1}}}}}} > 2 | {{{avatar3|{{{6|[[File:{{{id|{{{1|0}}}}}}_3.gif|{{{name|{{{2|<Player's Name Unknown>}}}}}}'s 3rd Avatar]]}}}}}}}} {{#ifexpr: {{{avatarcount|{{{3|1}}}}}} > 3 | {{{avatar4|{{{7|[[File:{{{id|{{{1|0}}}}}}_4.gif|{{{name|{{{2|<Player's Name Unknown>}}}}}}'s 4th Avatar]]}}}}}}}} {{#ifexpr: {{{avatarcount|{{{3|1}}}}}} > 4 | {{{avatar5|{{{8|[[File:{{{id|{{{1|0}}}}}}_5.gif|{{{name|{{{2|<Player's Name Unknown>}}}}}}'s 5th Avatar]]}}}}}}}} {{#ifexpr: {{{avatarcount|{{{3|1}}}}}} > 5 | {{{avatar6|{{{9|[[File:{{{id|{{{1|0}}}}}}_6.gif|{{{name|{{{2|<Player's Name Unknown>}}}}}}'s 6th Avatar]]}}}}}}}} {{#ifexpr: {{{avatarcount|{{{3|1}}}}}} > 6 | {{{avatar7|{{{10|[[File:{{{id|{{{1|0}}}}}}_7.gif|{{{name|{{{2|<Player's Name Unknown>}}}}}}'s 7th Avatar]]}}}}}}}} {{#ifexpr: {{{avatarcount|{{{3|1}}}}}} > 7 | {{{avatar8|{{{11|[[File:{{{id|{{{1|0}}}}}}_8.gif|{{{name|{{{2|<Player's Name Unknown>}}}}}}'s 8th Avatar]]}}}}}}}} {{#ifexpr: {{{avatarcount|{{{3|1}}}}}} > 8 | {{{avatar9|{{{12|[[File:{{{id|{{{1|0}}}}}}_9.gif|{{{name|{{{2|<Player's Name Unknown>}}}}}}'s 9th Avatar]]}}}}}}}}</includeonly><noinclude>
#ifexpr: {{CURRENTYEAR}} - 2018 <= 1
| style="background-color: #AAFFAA; {{style}}"
| {{
  #ifexpr: {{CURRENTYEAR}} - 2018 = 2
  | style="background-color: #CCFF99; {{style}}"
  | {{
    #ifexpr: {{CURRENTYEAR}} - 2018 = 3
    | style="background-color: #FFFF77; {{style}}"
    | style="background-color: #FFAAAA; {{style}}"
    }}
  }}
}}</includeonly><noinclude>




Line 14: Line 25:
Always give a template a category, even if it is [[:Category:Test Templates]]. For help on how a template works, read some [[MetaWikipedia:Help:Template|documentation]].
Always give a template a category, even if it is [[:Category:Test Templates]]. For help on how a template works, read some [[MetaWikipedia:Help:Template|documentation]].


Current Test: CustomAvatarTr
Current Test: StandardExpirationBgcolor


==Options==
==Options==
All arguments (expect for aname) are both positional and keyword selectable with the keywords have precedes over poitional.
All arguments are both positional and keyword selectable.
Meaning <code><nowiki>{{Template:CustomAvatarTr|1|[[Jick]]|7|[[File:jick_avatar.gif]]}}</nowiki></code> is the same as <code><nowiki>{{Template:CustomAvatarTr|id=1|avatar1=[[File:jick_avatar.gif]]|avatarcount=7|name=[[Jick]]}}</nowiki></code>
 
* <code>id</code> The player's ID number. Defaults to '<Player's Name Unknown>'.
* <code>year</code>: '''Required'''. The year in which the current item, skill, or familiar was released. This is used to pick the correct background color.
* <code>name</code> The player's in-game name. Defaults to '0'.
* <code>style</code>: ''Optional''. Additional CSS style(s) to apply.
* <code>avatarcount</code> The number of avatars the player has. Defaults to '1'. If no avatarN argument is supplied then the template will use '{{{id}}}_N.gif' instead. ( '{{{id}}}.gif' will be used for avatarcount=1 )
* <code>avatarN</code> A keyword assignment of a particular avatar. Defaults to '[[File:{{{id}}}.gif]]'. avatarN will only show if avatarcount >= N. The image should be a mediawiki File include not just the file name. Note: N is valid for numbers from 0-9. 0 will cause no images to be used.
* <code>aname</code> Anchor name (use when the monster name has special characters that cannot be used in a CSS id specifier). Defaults to 'player-id-{{{id}}}'.


==Examples==
==Examples==
<nowiki>{{Template:Test|1|jick|7|jick_avatar.gif|jick_avatar2.gif|avatar4=jick_avatar4.gif|jick_avatar3.gif}}</nowiki>
<nowiki>
{| border="1px" cellpadding="4px" cellspacing="0" style="margin:1em; text-align:center; width: 100%"
{| class="wikitable" style="text-align: center"
|- style="background-color:#EFEFEF;"
! Item
! Player Name !! Player ID !! Custom Avatar(s)
! Released on
{{Template:Test|1|[[Jick]]|7|[[File:jick_avatar.gif]]|[[File:jick_avatar2.gif]]|[[File:jick_avatar3.gif]]}}
|-
{{Template:Test|6|[[Multi Czar]]|1|aname="bob"|[[File:Avatar_6.gif]]}}
| [[packaged knock-off retro superhero cape]]
{{Template:Test|1061|Janice is Uber Cool|2}}
| {{Template:Test|year=2020}} | Nov. 2020
{{Template:Test|4576|[[BoozerBear]]}}
|-
{{Template:Test|4576|[[BoozerBear]]|4}}
| [[unopened diabolic pizza cube box]]
| {{Template:Test|year=2019|text-align: right}} | Nov. 2019
|-
| [[voter registration form]]
| {{Template:Test|year=2018}} | Nov. 2018
|-
| [[pantogram]]
| {{Template:Test|year=2017}} | Nov. 2017
|-
| [[Build-a-City Gingerbread kit]]
| {{Template:Test|year=2016}} | Dec. 2016
|}
|}
</nowiki>
[[Category:Utility Templates|{{PAGENAME}}]]
[[Category:Utility Templates|{{PAGENAME}}]]
</noinclude>
</noinclude>

Revision as of 00:41, 10 November 2020


{{Test}}
{{

#ifexpr: {{CURRENTYEAR}} - 2018 <= 1 | style="background-color: #AAFFAA; {{style}}" | {{ #ifexpr: {{CURRENTYEAR}} - 2018 = 2 | style="background-color: #CCFF99; {{style}}" | {{ #ifexpr: {{CURRENTYEAR}} - 2018 = 3 | style="background-color: #FFFF77; {{style}}" | style="background-color: #FFAAAA; {{style}}" }} }}

}}

Instructions

Similar to the Sandbox, this page is here for you to play around with templates. Do what you like with it, but please leave this explanatory section.

Insert your desired template contents above between the "includeonly" tags, and alter the instance below to include any parameters you may need. You may need to purge this page to see the effects of changes to this template's code. The same also holds for any other template. Otherwise, you may have to wait several minutes before the wiki starts using the new code.

Always give a template a category, even if it is Category:Test Templates. For help on how a template works, read some documentation.

Current Test: StandardExpirationBgcolor

Options

All arguments are both positional and keyword selectable.

  • year: Required. The year in which the current item, skill, or familiar was released. This is used to pick the correct background color.
  • style: Optional. Additional CSS style(s) to apply.

Examples

{| class="wikitable" style="text-align: center"
! Item
! Released on
|-
| [[packaged knock-off retro superhero cape]]
| {{Template:Test|year=2020}} | Nov. 2020
|-
| [[unopened diabolic pizza cube box]]
| {{Template:Test|year=2019|text-align: right}} | Nov. 2019
|-
| [[voter registration form]]
| {{Template:Test|year=2018}} | Nov. 2018
|-
| [[pantogram]]
| {{Template:Test|year=2017}} | Nov. 2017
|-
| [[Build-a-City Gingerbread kit]]
| {{Template:Test|year=2016}} | Dec. 2016
|}