Jump to content

Template:Filter/doc: Difference between revisions

From The Petit Planet Wiki
Creating Template:Filter/doc - Template doesn't work at the moment. Will figure out why later
 
No edit summary
Line 13: Line 13:


==Example==
==Example==
<pre>
{{Filter/Header|message=Click on the buttons to apply a filter to the list of [[creature]]s.}}
{{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|category|Fish,Insects,Shore-Dwellers|Fish,Insects,Shore-Dwellers|}}
Line 23: Line 24:
! 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}: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-category=",,"><td>[[File:%PAGE% Icon.png|x30px|link=%PAGE%]]</td><td>[[,,]]</td><td>,,</td></tr>
|ordermethod=sortkey
|ordermethod = sortkey
|count=40
|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}}
{| 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
}}
}}
|}
|}

Revision as of 19:37, 12 November 2025

This is the documentation page for Filter.
It contains usage information, categories, and other content not part of the original template page.
This template uses Module:FilterBuilder (edit | hist), a script written in Lua.

Template that creates filters for fiterable tables. To be used in conjuction with {{Filter/Header}} and {{Filter/Footer}}.

Usage

{{Filter|<1>|<2>|<3>|<4>}}

This template has up to 4 unnamed parameters:

  • 1 — Name of data group being filtered. Required
  • 2 / value — Comma separated list of possible values for the data group
  • 3 / display — Comma separated list of corresponding displays for the values (e.g., an icon)
  • 4 / default — Comma separated list of default applied filters

Example

{{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
}}
|}

Click on the buttons to apply a filter to the list of creatures.

Fish
Insects
Shore-Dwellers
Reset all filters
Icon Creature Category
AnchovyFish
Angel Red ShrimpShore-Dweller
Aurora SwallowtailInsect
Azure Metallic Hedge BlueInsect
Banded Coral ShrimpShore-Dweller
Bay SalmonFish
Bean-Shaped Fist CrabShore-Dweller
Black CarpFish
Black Chafer BeetleInsect
Black CrabShore-Dweller
Black TilapiaFish
Blackfin PearlfishFish
Blackspot TuskfishFish
Blue BlanquilloFish
Blue Neon CichlidFish
Blue TangFish
Blue Trim ParrotfishFish
BluebottleInsect
Bluecheek ButterflyfishFish
Bluelined AngelfishFish
BumblebeeInsect
Butterfly DragonflyInsect
Canary WrasseFish
Candy-Striped ShrimpShore-Dweller
Coffee Clearwing MothInsect
Constable ButterflyInsect
Crimson Marsh GliderInsect
Crimson Tip ButterflyInsect
Cushion StarShore-Dweller
Dark SnakeheadFish
Deep-Sea Coral CrabShore-Dweller
Elephant Hawk MothInsect
Emperor AngelfishFish
Empress ButterflyInsect
Fire EelFish
Fire UrchinShore-Dweller
FireflyInsect
Five-Bar SwordtailInsect
Flat Rock CrabShore-Dweller
Flat‑Clawed Hermit CrabShore-Dweller