Template:Filter/doc: Difference between revisions
Template page
More actions
No edit summary |
mNo edit summary |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{Documentation/Header}} | {{Documentation/Header}} | ||
{{Lua|FilterBuilder}} | {{Lua|FilterBuilder}} | ||
{{CSS|Template:Filter/styles}} | |||
{{See also|Template:Search}} | |||
Template that creates filters for fiterable tables. To be used in conjuction with {{T|Filter/Header}} and {{T|Filter/Footer}}. | Template that creates filters for fiterable tables. To be used in conjuction with {{T|Filter/Header}} and {{T|Filter/Footer}}. | ||
== | ==Syntax== | ||
<pre>{{Filter|<1>|<2>|<3>|<4>}}</pre> | <pre>{{Filter|<1>|<2>|<3>|<4>}}</pre> | ||
This template has up to 4 unnamed parameters: | This template has up to 4 unnamed parameters: | ||
| Line 14: | Line 15: | ||
==Example== | ==Example== | ||
<pre> | <pre> | ||
{{Filter/Header| | {{Filter/Header|[[creature]]s}} | ||
{{Filter|category|Fish, | {{Filter|category|Fish,Insect,Shore-Dweller|Fish,Insect,Shore-Dweller}} | ||
{{Search|dataKey=name|placeholder=Search by creature}} | |||
{{Filter|reset}} | {{Filter|reset}} | ||
{{Filter/Footer}} | {{Filter/Footer}} | ||
| Line 27: | Line 29: | ||
|uses = Template:Creature Infobox | |uses = Template:Creature Infobox | ||
|category = Creatures | |category = Creatures | ||
|include = {Creature Infobox}:category,{Creature Infobox}:name,{Creature Infobox}:category | |include = {Creature Infobox}:name,{Creature Infobox}:category,{Creature Infobox}:name,{Creature Infobox}:category | ||
|format = ,,, | |format = ,,, | ||
|secseparators = <tr class="filter-element" data-category=",,"><td>[[File:%PAGE% Icon.png|x30px|link=%PAGE%]]</td><td>[[,,]]</td><td>,,</td></tr> | |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 | |ordermethod = sortkey | ||
|count = 40 | |count = 40 | ||
| Line 35: | Line 37: | ||
|} | |} | ||
</pre> | </pre> | ||
{{Filter/Header| | {{Filter/Header|[[creature]]s}} | ||
{{Filter|category|Fish, | {{Filter|category|Fish,Insect,Shore-Dweller|Fish,Insect,Shore-Dweller}} | ||
{{Search|dataKey=name|placeholder=Search by creature}} | |||
{{Filter|reset}} | {{Filter|reset}} | ||
{{Filter/Footer}} | {{Filter/Footer}} | ||
| Line 48: | Line 51: | ||
|uses = Template:Creature Infobox | |uses = Template:Creature Infobox | ||
|category = Creatures | |category = Creatures | ||
|include = {Creature Infobox}:category,{Creature Infobox}:name,{Creature Infobox}:category | |include = {Creature Infobox}:name,{Creature Infobox}:category,{Creature Infobox}:name,{Creature Infobox}:category | ||
|format = ,,, | |format = ,,, | ||
|secseparators = <tr class="filter-element" data-category=",,"><td>[[File:%PAGE% Icon.png|x30px|link=%PAGE%]]</td><td>[[,,]]</td><td>,,</td></tr> | |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 | |ordermethod = sortkey | ||
|count = 40 | |count = 40 | ||
}} | }} | ||
|} | |} | ||