Difference between revisions of "Template:Set list/doc"

From Yugipedia
Jump to: navigation, search
(Updating documentation. Adding "see also" section.)
(Add one more example.)
 
(3 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
<!-- PLEASE ADD CATEGORIES AT THE BOTTOM OF THIS PAGE -->
 
<!-- PLEASE ADD CATEGORIES AT THE BOTTOM OF THIS PAGE -->
 
{{TOC}}
 
{{TOC}}
This template is meant to be used to generate [[:Category:Set Card Lists|set lists]].
+
{{Lua|Module:Card collection/modules/Set list}}
 +
This template is used to generate [[:Category:Set Card Lists|set lists]].
  
 
== Usage ==
 
== Usage ==
 
<pre>
 
<pre>
{{Set list|region=|set=|abbr=|rarity=|qty=|header=|col=|
+
{{Set list|region=|rarities=|options=|print=|qty=|description=|$description=|columns=|$columns=|
 
+
&lt;card number>; &lt;card name>; &lt;card rarities>; &lt;print>; &lt;quantity> // &lt;entry options>
 
}}
 
}}
 
</pre>
 
</pre>
  
To use to build lists that have multiple headers, one transclusion per header section should be used.
+
Each template call builds one list only. For multiple lists on the same page, multiple calls to the template must be made.
 +
Ideally, for this case, each separate list should have its own MediaWiki header.
 +
<br />
 +
For the page header, {{T|Set page header}} must be used.
  
 
=== Parameters ===
 
=== Parameters ===
 +
All parameters are optional except where noted.
 +
 
;<code>region</code>  
 
;<code>region</code>  
:'''Required''' parameter on the first transclusion. Used to pass a region index (e.g., <code>EN</code>, <code>NA</code>, <code>AE</code>, etc.).
+
:'''Required''' parameter. Used to pass a region (e.g., <code>EN</code>, <code>French</code>, <code>AE</code>).
;<code>set</code>  
+
 
:Optional parameter. Used to pass a set name.
+
;<code>rarities</code>  
;<code>abbr</code>  
+
:Used to pass the rarities of the card. Each rarity should be separated by a <code>,</code>. The rarities entered here will be used as default, in case no rarities are passed into each individual entry.
:Optional parameter. Used to pass a set abbreviation code. If set to <code>no</code>, <code>none</code>, <code>off</code>, <code>false</code> or <code>0</code>, the card number column is not displayed.
+
 
;<code>rarity</code>  
+
;<code>options</code>
:Optional parameter. Used to pass the rarities of the card. Each rarity should be separated by a <code>,</code>.
+
:Receives a list of options. Each option is separated by <code>;</code>. Currently, the available options are:
;<code>qty</code>  
+
:*<code>noabbr</code>: Omits the card number column. Indicates the cards don't have a card number.
:Optional parameter. Used to pass a quantity value each card entry. This value would apply to all the entries, unless a specific value is passed for the individual entry, or unless the value entered is not numerical, in which case it will default to <code>1</code>.
+
 
;<code>header</code>  
+
;<code>print</code>  
:Optional parameter. Used to generate a header. The header text is the value passed. If <code>row</code> is used, this value will be the column header name.
+
:Used to indicate if a card was introduced in a set or reprinted from an earlier set. The column's default value is the value passed. This parameter can be used empty, to just display the column with empty cells.
;<code>col</code>  
+
 
:Optional parameter. Used to generate a new column. The column header text is the value passed.
+
;<code>qty</code>
 +
:Used to pass a quantity value. The value must be convertible to a number. The column's default value is the value passed. This parameter can be used empty, to just display the column with empty cells.
 +
 
 +
;<code>description</code>  
 +
:Appends a description to the English card name. The value passed will be used as a default value.  
 +
 
 +
;<code>$description</code>  
 +
:Sets a template description. <!--TODO: @see some docs about interpolation.-->
 +
 
 +
;<code>columns</code>
 +
:Receives a list of pairs. Each pair is separated by <code>;</code> and consist of a column name and the column default value, separated by `::`. To omit the default value, just enter the column name (e.g., <code>columns=Notes::Default notes; More notes</code>). Each pair will append a new column to the list generated.
 +
 
 +
;<code>$columns</code>  
 +
:Receives a list of pairs, just like the above, but the value is a template for the column content.
 +
 
 +
=== Building an entry ===
 +
Each entry goes in one line.<br />
 +
Entries are in the form of <code>&lt;card number>; &lt;card name>; &lt;card rarities>; &lt;print>; &lt;quantity> // &lt;entry options></code>.
 +
 
 +
;<code>card number</code>
 +
:The card number. For cards that don't have a card number, it should be left blank (but still separated from the card name). If the global option <code>noabbr</code> is used, the card number is omitted and the first value will be considered as the card name, the second the card rarities and so on.
 +
 
 +
;<code>card name</code>
 +
:The card English name or the pagename. Supports <code>#</code> in the card name. If the card English name uses less common characters, it's advised to input the pagename here and use the entry option <code>force-SMW</code>.
 +
 
 +
;<code>card rarities</code>
 +
:All of the card's rarities, separated by <code>,</code>. If left empty, the default rarities defined in parameter <code>rarities</code> will be used.
 +
 
 +
;<code>print</code>
 +
:Only takes effect if the parameter <code>print</code> is in use. Indicates the card print. If left empty, the default print value, if any, defined in parameter <code>print</code> will be used. If parameter <code>print</code> was not used, this field is skipped and will be considered as the quantity, in case the parameter <code>qty</code> is in use.
  
=== Building a row ===
+
;<code>quantity</code>
Each entry goes in one row.<br />
+
:Only takes effect if the parameter <code>qty</code> is in use. Indicates the fixed amount of copies of this card present in this set. If left empty, the default quantity value, if any, defined in parameter <code>qty</code> will be used.
Rows are composed of <code>''card number''; ''card name''; ''rarity''; ''qty''; // options</code>. For cards that don't have a card number, it should be left blank. For sets that do not have a set index, the first value should be the card name and <code>abbr</code> should be disabled.<br />
 
The options part is optional and is separated by inserting <code>//</code> and then the options keys. These are:
 
;<code>number::''&lt;value>''</code>  
 
:Overrides the card number with whatever value is entered here.
 
;<code>name::''&lt;value>''</code>  
 
:Overrides the card name with whatever value is entered here.
 
;<code>name-local::''&lt;value>''</code>
 
:Overrides the localized card name with whatever value is entered here.
 
;<code>rarity::''&lt;value>''</code>
 
:Overrides the rarity values cell with whatever value is entered here.
 
;<code>category::''&lt;value>''</code>
 
:Overrides the category cell with whatever value is entered here.
 
;<code>description::''&lt;value>''</code>
 
:Adds a description next to the English name.
 
If <code>col</code> was used, using the lower cased value entered there followed by <code>::</code> and a value, will populate the cell from that extra column with the value entered here.
 
  
=== Building a group ===
+
==== Entry options ====
Groups of rows can be assembled. Ideally, they should be separated by headers.<br />
+
The options part is optional and is separated by inserting <code>//</code> and then the options pairs. Each option is a pair separated by <code>;</code> and consists of an option name and the respective value, separated by `::`. Available options are:
Groups are generated by entering <code>!: </code> at the beginning of the line, preceding the following options, each separated by <code>;</code>:
+
 
;<code>header::''&lt;value>''</code>  
+
;<code>printed-name::&lt;old name></code>  
:Adds a header. The header text is whatever value entered here.
+
:Used for when the card was released in that set with a name different the current name. This appends the old name to the localized name this list represents, so this should be used only if the name of the card in that language was different at the time of release than it is now.
;<code>rarity::''&lt;value>''</code>  
+
 
:Defines a rarity for all entries in this group, unless a particular one was entered.
+
;<code>description::&lt;value></code>  
;<code>qty::''&lt;value>''</code>  
+
:Adds a description next to the English name. If this is not used but the <code>description</code> parameter is used, it will display the default <code>description</code>. If a value is present, it will display that value (regardless of the default <code>description</code>). The only exception is if <code>$description</code> was used; the value passed here will be interpolated to the template value defined by <code>$description</code>.
:Defines a quantity value for all the entries in this group, unless a particular one was entered.
+
 
 +
;<code>force-SMW</code>  
 +
:This option enables extra fetching from SMW properties. This option is to be used when there is a need to get the card English name from the pagename (provided as input).
 +
 
 +
Besides these default options, other special options are supported to fill the cells for the columns added through <code>columns</code> and <code>$columns</code>. Each column content option is called like any other option, except the name is the column name and it must be prepended with <code>@</code>. So if <code>columns=My column</code> is used, then to populate the cell for that column in this entry, <code>@My column::&lt;column content></code> must be used. If the column option is used but left blank, it will clear the default value, if any, ignore the template, if any, and display blank.
  
 
== Examples ==
 
== Examples ==
* [[Set Card Lists:Duelist Pack: Jaden Yuki 2 (TCG-FR)]]
+
* [[Set Card Lists:Duelist Pack: Jaden Yuki 2 (TCG-FR)]] (Use of the <code>printed-name</code> entry option.)
* [[Set Card Lists:Booster 3 (OCG-JP)]]
+
* [[Set Card Lists:Booster 3 (OCG-JP)]] (Use of the <code>noabbr</code> option.)
* [[Set Card Lists:Yu-Gi-Oh! ZEXAL manga promotional cards (OCG-JP)]]
+
* [[Set Card Lists:Yu-Gi-Oh! ZEXAL manga promotional cards (OCG-JP)]] (Use of custom columns.)
 +
* [[Set Card Lists:Yu-Gi-Oh! ZEXAL manga promotional cards (TCG-EN)]] (Use of custom columns with interpolation.)
 +
* [[Set Card Lists:777 Treasure Campaign (OCG-JP)]] (Use of <code>force-SMW</code> entry option.)
  
 
== Tracking categories ==
 
== Tracking categories ==
* [[:Category:((Set list)) with parameters to be checked]]
+
* [[:Category:((Set list)) transclusions to be checked]]: General category that contains all pages using {{t|Set list}} with errors. Each page present in the following categories is also present on this one.
 +
 
 +
* [[:Category:((Set list)) transclusions with invalid parameters]]: There are parameters in use that are not part of this template.
 +
* [[:Category:((Set list)) transclusions with missing required parameters]]: There are template parameters that are required but were not entered.
 +
* [[:Category:((Set list)) transclusions with empty parameters]]: There are template parameters in use that are not receiving any value, but should always receive a non-empty value when used.
 +
* [[:Category:((Set list)) transclusions with empty options]]: There is a place that receives input in the options format but received empty options.
 +
 
 +
* [[:Category:((Set list)) transclusions with invalid region]]: The region provided was invalid.
 +
* [[:Category:((Set list)) transclusions with duplicate rarities]]: The list of rarities provided for the default rarities or for an entry contains the same rarity multiple times.
 +
* [[:Category:((Set list)) transclusions with invalid rarities]]: The list of rarities provided for the default rarities or for an entry contains rarities that are not valid.
 +
* [[:Category:((Set list)) transclusions with empty rarities]]: The list of rarities provided for the default rarities or for an entry contains multiple straight <code>,</code> (empty rarities).
 +
* [[:Category:((Set list)) transclusions with invalid quantity values]]: The quantity value provided for the default quantity or for an entry cannot be parsed as a number.
 +
* [[:Category:((Set list)) transclusions with empty printed-name]]: The entry option <code>printed-name</code> is used but it's empty.
 +
* [[:Category:((Set list)) transclusions with printed-name but no card name]]: The entry option <code>printed-name</code> is used but there is no card name inputted.
 +
 
 +
Each page tagged with each of these tracking categories presents details about the errors.
  
 
== See also ==
 
== See also ==
* {{t|Set gallery}}
+
* [[Module:Card collection/modules/Set list]]
 +
* [[Module:Card collection]]
  
 
<includeonly>
 
<includeonly>

Latest revision as of 10:42, 6 May 2023

This template is used to generate set lists.

Usage[edit]

{{Set list|region=|rarities=|options=|print=|qty=|description=|$description=|columns=|$columns=|
<card number>; <card name>; <card rarities>; <print>; <quantity> // <entry options>
}}

Each template call builds one list only. For multiple lists on the same page, multiple calls to the template must be made. Ideally, for this case, each separate list should have its own MediaWiki header.
For the page header, {{Set page header}} must be used.

Parameters[edit]

All parameters are optional except where noted.

region
Required parameter. Used to pass a region (e.g., EN, French, AE).
rarities
Used to pass the rarities of the card. Each rarity should be separated by a ,. The rarities entered here will be used as default, in case no rarities are passed into each individual entry.
options
Receives a list of options. Each option is separated by ;. Currently, the available options are:
  • noabbr: Omits the card number column. Indicates the cards don't have a card number.
print
Used to indicate if a card was introduced in a set or reprinted from an earlier set. The column's default value is the value passed. This parameter can be used empty, to just display the column with empty cells.
qty
Used to pass a quantity value. The value must be convertible to a number. The column's default value is the value passed. This parameter can be used empty, to just display the column with empty cells.
description
Appends a description to the English card name. The value passed will be used as a default value.
$description
Sets a template description.
columns
Receives a list of pairs. Each pair is separated by ; and consist of a column name and the column default value, separated by `::`. To omit the default value, just enter the column name (e.g., columns=Notes::Default notes; More notes). Each pair will append a new column to the list generated.
$columns
Receives a list of pairs, just like the above, but the value is a template for the column content.

Building an entry[edit]

Each entry goes in one line.
Entries are in the form of <card number>; <card name>; <card rarities>; <print>; <quantity> // <entry options>.

card number
The card number. For cards that don't have a card number, it should be left blank (but still separated from the card name). If the global option noabbr is used, the card number is omitted and the first value will be considered as the card name, the second the card rarities and so on.
card name
The card English name or the pagename. Supports # in the card name. If the card English name uses less common characters, it's advised to input the pagename here and use the entry option force-SMW.
card rarities
All of the card's rarities, separated by ,. If left empty, the default rarities defined in parameter rarities will be used.
print
Only takes effect if the parameter print is in use. Indicates the card print. If left empty, the default print value, if any, defined in parameter print will be used. If parameter print was not used, this field is skipped and will be considered as the quantity, in case the parameter qty is in use.
quantity
Only takes effect if the parameter qty is in use. Indicates the fixed amount of copies of this card present in this set. If left empty, the default quantity value, if any, defined in parameter qty will be used.

Entry options[edit]

The options part is optional and is separated by inserting // and then the options pairs. Each option is a pair separated by ; and consists of an option name and the respective value, separated by `::`. Available options are:

printed-name::<old name>
Used for when the card was released in that set with a name different the current name. This appends the old name to the localized name this list represents, so this should be used only if the name of the card in that language was different at the time of release than it is now.
description::<value>
Adds a description next to the English name. If this is not used but the description parameter is used, it will display the default description. If a value is present, it will display that value (regardless of the default description). The only exception is if $description was used; the value passed here will be interpolated to the template value defined by $description.
force-SMW
This option enables extra fetching from SMW properties. This option is to be used when there is a need to get the card English name from the pagename (provided as input).

Besides these default options, other special options are supported to fill the cells for the columns added through columns and $columns. Each column content option is called like any other option, except the name is the column name and it must be prepended with @. So if columns=My column is used, then to populate the cell for that column in this entry, @My column::<column content> must be used. If the column option is used but left blank, it will clear the default value, if any, ignore the template, if any, and display blank.

Examples[edit]

Tracking categories[edit]

Each page tagged with each of these tracking categories presents details about the errors.

See also[edit]