Editing Template:Filter/doc
Appearance
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision | Your text | ||
| Line 1: | Line 1: | ||
{{Documentation/Header}} | {{Documentation/Header}} | ||
{{ | {{Lua|FilterBuilder}} | ||
== | Template that creates filters for fiterable tables. To be used in conjuction with {{T|Filter/Header}} and {{T|Filter/Footer}}. | ||
< | |||
{{Filter | ==Usage== | ||
<pre>{{Filter|<1>|<2>|<3>|<4>}}</pre> | |||
This template has up to 4 unnamed parameters: | |||
* <code>1</code> — Name of data group being filtered. '''''{{Color|New|Required}}''''' | |||
* <code>2</code> / <code>value</code> — Comma separated list of possible values for the data group | |||
|1 | * <code>3</code> / <code>display</code> — Comma separated list of corresponding displays for the values (e.g., an icon) | ||
* <code>4</code> / <code>default</code> — Comma separated list of default applied filters | |||
|2 | |||
|3 | |||
| | |||
}} | |||
</ | |||
* | |||
* | |||
* | |||
* | |||
==Example== | ==Example== | ||
{{Filter/Header| | <pre> | ||
{{Filter | {{Filter/Header|message=Click on the buttons to apply a filter to the list of [[creature]]s.}} | ||
| | {{Filter|category|Fish,Insects,Shore-Dwellers|Fish,Insects,Shore-Dwellers|}} | ||
| | {{Filter|reset}} | ||
| | {{Filter/Footer}} | ||
| | {| class="wikitable sortable" | ||
| | |- | ||
! Icon | |||
! Creature | |||
! Category | |||
{{#DPL: | |||
| | |namespace = | ||
|uses = Template:Creature Infobox | |||
|category = Creatures | |||
|include = {Creature Infobox}:category,{Creature Infobox}:name,{Creature Infobox}:category | |||
|format = ,,, | |||
| | |secseparators = <tr class="filter-element" data-category=",,"><td>[[File:%PAGE% Icon.png|x30px|link=%PAGE%]]</td><td>[[,,]]</td><td>,,</td></tr> | ||
|ordermethod = sortkey | |||
|count = 40 | |||
}} | }} | ||
|} | |||
</pre> | |||
{{Filter/Header|message=Click on the buttons to apply a filter to the list of [[creature]]s.}} | |||
{{Filter|category|Fish,Insects,Shore-Dwellers|Fish,Insects,Shore-Dwellers|}} | |||
{{Filter|reset}} | |||
{{Filter/Footer}} | {{Filter/Footer}} | ||
{{# | {| class="wikitable sortable" | ||
| | |- | ||
| | ! Icon | ||
| | ! Creature | ||
! Category | |||
{{#DPL: | |||
|format = | |namespace = | ||
| | |uses = Template:Creature Infobox | ||
|category = Creatures | |||
|include = {Creature Infobox}:category,{Creature Infobox}:name,{Creature Infobox}:category | |||
|format = ,,, | |||
|secseparators = <tr class="filter-element" data-category=",,"><td>[[File:%PAGE% Icon.png|x30px|link=%PAGE%]]</td><td>[[,,]]</td><td>,,</td></tr> | |||
|ordermethod = sortkey | |||
|count = 40 | |||
| | |||
}} | }} | ||
|} | |||