Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Filter/doc: Difference between revisions

Template page
Creating Template:Filter/doc - Template doesn't work at the moment. Will figure out why later
 
mNo edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Documentation/Header}}
{{Documentation/Header}}
{{Lua|FilterBuilder}}
{{Lua|FilterBuilder}}
 
{{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}}.


Line 13: Line 13:


==Example==
==Example==
{{Filter/Header|message=Click on the buttons to apply a filter to the list of [[creature]]s.}}
<pre>
{{Filter|category|Fish,Insects,Shore-Dwellers|Fish,Insects,Shore-Dwellers|}}
{{Filter/Header|[[creature]]s}}
{{Filter|category|Fish,Insect,Shore-Dweller|Fish,Insect,Shore-Dweller}}
{{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,Insect,Shore-Dweller|Fish,Insect,Shore-Dweller}}
{{Search|dataKey=name|placeholder=Search by creature}}
{{Filter|reset}}
{{Filter|reset}}
{{Filter/Footer}}
{{Filter/Footer}}
Line 23: Line 47:
! Category
! Category
{{#DPL:
{{#DPL:
|namespace=  
|namespace =
|uses=Template:Creature Infobox
|uses = Template:Creature Infobox
|category=Creatures
|category = Creatures
|include={Creature Infobox}:name,{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-search="," 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
}}
}}
|}
|}