Editing Template:Filter/doc
Template page
More actions
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}} | ||
{{ | {{See also|Template:Search}} | ||
Template that creates | Template that creates filters for fiterable tables. To be used in conjuction with {{T|Filter/Header}} and {{T|Filter/Footer}}. | ||
== | ==Usage== | ||
< | <pre>{{Filter|<1>|<2>|<3>|<4>}}</pre> | ||
{{Filter | 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 | |||
* <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 | |||
|1 | |||
|2 | |||
|3 | |||
| | |||
}} | |||
</ | |||
* | |||
* | |||
* | |||
* | |||
==Example== | ==Example== | ||
{{Filter/Header| | <pre> | ||
{{ | {{Filter/Header|[[creature]]s}} | ||
| | {{Filter|category|Fish,Insects,Shore-Dwellers|Fish,Insects,Shore-Dwellers}} | ||
| | {{Search|dataKey=name|placeholder=Search by creature}} | ||
| | {{Filter|reset}} | ||
| | {{Filter/Footer}} | ||
| | {| class="wikitable sortable" | ||
| | |- | ||
| | ! Icon | ||
! Creature | |||
! Category | |||
| | {{#DPL: | ||
|namespace = | |||
|uses = Template:Creature Infobox | |||
| | |category = Creatures | ||
|include = {Creature Infobox}:name,{Creature Infobox}:category,{Creature Infobox}:name,{Creature Infobox}:category | |||
|format = ,,, | |||
|secseparators = <tr class="filter-element" data-name=",," data-category=",,"><td>[[File:%PAGE% Icon.png|x30px|link=%PAGE%]]</td><td>[[,,]]</td><td>,,</td></tr> | |||
|ordermethod = sortkey | |||
|count = 40 | |||
}} | }} | ||
|} | |||
</pre> | |||
{{Filter/Header|[[creature]]s}} | |||
{{Filter|category|Fish,Insects,Shore-Dwellers|Fish,Insects,Shore-Dwellers}} | |||
{{Search|dataKey=name|placeholder=Search by creature}} | |||
{{Filter|reset}} | |||
{{Filter/Footer}} | {{Filter/Footer}} | ||
{{# | {| class="wikitable sortable" | ||
| | |- | ||
| | ! Icon | ||
| | ! Creature | ||
! Category | |||
{{#DPL: | |||
|format = | |namespace = | ||
| | |uses = Template:Creature Infobox | ||
|category = Creatures | |||
|include = {Creature Infobox}:name,{Creature Infobox}:category,{Creature Infobox}:name,{Creature Infobox}:category | |||
|format = ,,, | |||
|secseparators = <tr class="filter-element" data-name=",," data-category=",,"><td>[[File:%PAGE% Icon.png|x30px|link=%PAGE%]]</td><td>[[,,]]</td><td>,,</td></tr> | |||
|ordermethod = sortkey | |||
|count = 40 | |||
| | |||
}} | }} | ||
|} | |||