Open main menu

Yugipedia β

Changes

Updating links.
{{ #arraydefine: @RARITIES | {{{1|Common}}} | ,}}{{ #vardefineif: $COUNTER | 0}}{{ #if: {{ #arrayindex: @RARITIES 1| {{ #var: $COUNTER }} }} | [[{{ R | {{ #arrayindex: @RARITIES | {{ #var: $COUNTER }1} }} | full=yes Common }}]]| , }}{{ #if: {{ #arrayindexarrayprint: @RARITIES | {{ #vardefineechoswitch: $COUNTER | {{ #exprlc: {{ #var: $COUNTER }} + 1 }{space|} }} }} | left | both = <br nowiki/>[[{{ R | }} {{ #arrayindexif: @RARITIES | {{ #var: $COUNTER {2|}} }| {{{2} | full=yes }}]]| <br /> }}{{ #ifswitch: {{ #arrayindexlc: @RARITIES | {{ #vardefineecho: $COUNTER {space| {{ #expr: {{ #var: $COUNTER }} + 1 }} }} }} | right | both = <br nowiki/>[[{{ R }} | {{ #arrayindex: @RARITIES -PART | {{ #varvardefine: $COUNTER }} }} RARITY | {{r|@RARITIES-PART| full=yes }}]]}}{{ #if: {{ #arrayindexvar: @RARITIES $RARITY }} | {{ #vardefineechovardefine: $COUNTER RARITY-ABBR | {{ #exprif: {{ #var: $COUNTER }} + 1 }} }{abbr|} }} | <br />[[{{ R r| {{ #arrayindex: @RARITIES | {{ #var: $COUNTER -PART}} }} | full=yes }}]]}}{{ #ifswitch: {{ #arrayindexlc: @RARITIES {{{link|}}} }} | no | none | off | false | 0 = {{ #vardefineechovar: $COUNTER RARITY-ABBR | {{ #expr: {{ #var: $COUNTER }} + 1 }} RARITY }} }} | <br />#default = [[{{ R #var: $RARITY }}| {{ #arrayindexvar: @RARITIES $RARITY-ABBR | {{ #var: $COUNTER RARITY }} }} | full=yes ]] }} }}]] }}<noinclude>
==Usage==
{{tlx|:User:Becasita/SubPages/Templates/SetList/Row/ProcessRarities|''&lt;Rarities>''|''&lt;Separator>''|abbr|space|link}}
Receives a list of rarities. By default, it will print them with their full terminology, linked, one in each line. ;Receives two unnamed parameter as a ::'''1''': A list of rarities, divided separated by a comma (<code>,</code>). To a maximum of 5 raritiesNot case sensitive (see {{Tn|R}} for more info).Defaults to <code>[[Common]]<br /code>.It outputs :'''2''': A separator. In case there are two or more rarities, they will be outputted separated by the argument given to this parameter. Optional parameter. ;Receives three named parameters::'''abbr''': By default, the rarities are outputted with their full terminology(e.g., <code>[[Super Rare]]</code>); If this parameter is filled (with, for instance <code>1</code> or <code>yes</code>), one per linethe rarities will be outputted abbreviated (e.g., <code>[[SR]]</code>). Optional parameter.:'''space''': By default, there will be no spaces around the delimiter; This optional parameter serves to add said space. There are three possible keywords for this parameter::*<code>left</code>, which will add a space at the left of the delimiter;:*<code>right</code>, which will add a space at the right of the delimiter;:*<code>both</code>, which will add a space at both the left and the right of the delimiter.:'''link''': If set to <code>no</code> / <code>none</code> / <code>off</code> / <code>false</code> / <code>0</code>, the rarities will not be linked when outputted. Not case sensitiveOptional===Examples==={| class="wikitable"|-! scope="row" | Input| <nowiki>{{:User:Becasita/SubPages/Templates/ProcessRarities|C, r, sCR, utr}}</nowiki>|-! scope="row" | Output| {{:User:Becasita/SubPages/Templates/ProcessRarities|C, r, sCR, utr}}|-|} {| class="wikitable"|-! scope="row" | Input| <nowiki>{{:User:Becasita/SubPages/Templates/ProcessRarities| UPR, DNPR | / | space=both }}</nowiki>|-! scope="row" | Output| {{:User:Becasita/SubPages/Templates/ProcessRarities| UPR , DNPR | / | space=both }}|-|} {| class="wikitable"|-! scope="row" | Input| <nowiki>{{:User:Becasita/SubPages/Templates/ProcessRarities| GScR, SP | , | space=right }}</nowiki>|-! scope="row" | Output| {{:User:Becasita/SubPages/Templates/ProcessRarities| GScR, SP | , | space=right }}|-|}
===Example===
{| class="wikitable"
|-
! scope="row" | Input
| <nowiki>{{tlx|:User:Becasita/SubPages/Templates/SetList/Row/ProcessRarities|CNormal Rare,rNot a rarity,sCR,utrPlScR | ;<br /> | abbr=yes }}</nowiki>
|-
! scope="row" | Output
| {{:User:Becasita/SubPages/Templates/SetList/Row/ProcessRarities|CNormal Rare,rNot a rarity,sCR,utrPlScR | ;<br /> | abbr=yes }}
|-
|}
{| class="wikitable"|-! scope="row" | Input| <nowiki>{{:User:Becasita/SubPages/Templates/ProcessRarities| C, SP, SSP | or | space=both | link = none }}</nowiki>|-! scope="row" | Output| {{:User:Becasita/SubPages/Templates/ProcessRarities| C, SP, SSP | or | space=both | link = none }}|-|}</noinclude>
Bureaucrats, System administrator, Administrators
57,479
edits