Template:Filter/doc: Difference between revisions
Appearance
Template now works |
SteviumBot (talk | contribs) mNo edit summary |
||
| (5 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
{{Documentation/Header}} | {{Documentation/Header}} | ||
{{ | {{JS|Gadget-Filter|DataTables}} | ||
{{ | {{CSS|Gadget-Filter}} | ||
Template that creates filters for fiterable tables. To be used in conjuction with {{T|Filter/Header}} and {{T|Filter/Footer}}. | Template that creates a row of filters for fiterable tables. To be used in conjuction with {{T|Filter/Header}} and {{T|Filter/Footer}}. | ||
== | ==Syntax== | ||
< | <syntaxhighlight lang="wikitext" copy> | ||
{{Filter | |||
* | |column = | ||
* | |all = true | ||
* | |mode = | ||
* | |label = | ||
|1 = | |||
|query1 = | |||
|2 = | |||
|query2 = | |||
|3 = | |||
|query3 = | |||
}} | |||
</syntaxhighlight> | |||
* {{F|column}} – Table column number that will be queried for the filter. | |||
* {{F|mode}} – Set to: | |||
** {{F|exact}} for an "exact" filter. | |||
** {{F|contains}} for a "contains" filter. | |||
* {{F|label}} – Text label for filters. | |||
* {{F|((n))}} – Text displayed on the ''n''-th filter button. | |||
* {{F|query((n))}} – Text that will be queried upon pressing the ''n''-th filter button | |||
==Example== | ==Example== | ||
{{Filter/Header|id=neighbor-list|type=neighbors}} | |||
{{Filter/Header| | {{Filter | ||
{{Filter | |column = 4 | ||
|all = true | |||
|mode = contains | |||
|label = Galaxy: | |||
|1 = [[File:Hexia Icon.png|30px|link=|class=day-invert-image]] | |||
| | |query1 = Hexia | ||
|2 = [[File:Taffeh Icon.png|30px|link=|class=day-invert-image]] | |||
|query2 = Taffeh | |||
|3 = [[File:Norvan Icon.png|30px|link=|class=day-invert-image]] | |||
|query3 = Norvan | |||
| | }} | ||
| | {{Filter | ||
| | |column = 5 | ||
| | |all = true | ||
| | |label = Pronouns: | ||
| | |1 = He/Him | ||
| | |2 = She/Her | ||
| | |||
}} | }} | ||
{{Filter/Footer}} | {{Filter/Footer}} | ||
{{#invoke:Bucket|get|neighbors | |||
|select = page_name, birthday, role, galaxy, pronouns, loves, likes, dislikes | |||
|where = {{{where|}}} | |||
|filter = {{{filter|}}} | |||
|order by = page_name | |||
{{# | |||
| | |format = userformat | ||
| | |show resultsHeader = false | ||
| | |header = <!-- | ||
| | --><table id="neighbor-list" class="wikitable sortable"><!-- | ||
|format = | --><tr><!-- | ||
| | --><th class="unsortable">Icon</th><!-- | ||
| | --><th>Name</th><!-- | ||
| | --><th>Role</th><!-- | ||
--><th>Galaxy</th><!-- | |||
--><th>Pronouns</th><!-- | |||
--><th>Birthday</th><!-- | |||
--><th>Loves</th><!-- | |||
--><th>Likes</th><!-- | |||
--><th>Dislikes</th><!-- | |||
--></tr> | |||
|userformat = <!-- | |||
--><tr><!-- | |||
--><td>{{Item|size=50|%page_name%|notext=1}}</td><!-- | |||
--><td>[[%page_name%]]</td><!-- | |||
--><td>%role%</td><!-- | |||
--><td><nowiki>{{#if:%galaxy%|{{Item|%galaxy%|invert=Day}}}}</nowiki></td><!-- | |||
--><td>%pronouns%</td><!-- | |||
--><td>%birthday%</td><!-- | |||
--><td><nowiki>{{Item List|%loves%}}</nowiki></td><!-- | |||
--><td><nowiki>{{List|%likes%}}</nowiki></td><!-- | |||
--><td><nowiki>{{List|%dislikes%}}</nowiki></td><!-- | |||
--></tr> | |||
|footer = </table> | |||
}} | }} | ||
Latest revision as of 15:02, 11 May 2026
This is the documentation page for Filter. It contains usage information, categories, and other content not part of the original template page. | ||
|---|---|---|
| Main | Documentation | Usage |
This template uses JS found at MediaWiki:Gadget-Filter.js and MediaWiki:DataTables.js.
This template uses CSS found at MediaWiki:Gadget-Filter.css.
Template that creates a row of filters for fiterable tables. To be used in conjuction with {{Filter/Header}} and {{Filter/Footer}}.
Syntax
[edit source]{{Filter
|column =
|all = true
|mode =
|label =
|1 =
|query1 =
|2 =
|query2 =
|3 =
|query3 =
}}
- column – Table column number that will be queried for the filter.
- mode – Set to:
- exact for an "exact" filter.
- contains for a "contains" filter.
- label – Text label for filters.
- n – Text displayed on the n-th filter button.
- queryn – Text that will be queried upon pressing the n-th filter button
Example
[edit source]Click on the buttons or type in the provided search box below to apply a filter to the list of neighbors.
Galaxy:
Pronouns:
Search:
Showing of results:
| Icon | Name | Role | Galaxy | Pronouns | Birthday | Loves | Likes | Dislikes |
|---|---|---|---|---|---|---|---|---|
| Mors | Curator of the Omni-Gallery | He/Him | December 8th | |||||
| Mobai | Life Coordinator | He/Him | February 19th | |||||
| Frostia | Mystic Scholar | She/Her | September 9th |
| ||||
| Glenn | Shopkeeper | He/Him | May 1st | |||||
| Isaki | Battle Beetle Trainer | He/Him | July 22nd |
|
| |||
| Medowlyn | Plushie Designer | She/Her | July 5th |
|
| |||
| Yunguo | Cultivator | She/Her | September 19th |
|
| |||
| Elsasani | Starsea Racer | She/Her | February 14th | |||||
| Dorjelang | Hatmaker | He/Him | May 2nd |
|
| |||
| Msafiri | Adventure Guide | He/Him | August 8th |
|
| |||
| Rebella | Gemsmith | She/Her | February 9th |
|
| |||
| Nerina | Composer | She/Her | June 8th |
|
| |||
| Harpeno | Starsea Patrol Officer | She/Her | December 7th |
|
| |||
| Trixie | She/Her | |||||||
| Manna | Action Actor | She/Her | February 22nd |
|
| |||
| Tika | Agriculture Student | She/Her | August 16th |
|
| |||
| Heyu | Hot Spring Innkeeper | He/Him | February 15th |
|
| |||
| Petit Planet Wiki:Petit Planet:Sandbox/Infobox | Petit Planet Wiki:Petit Planet:Sandbox/Infobox | Village Resident | Milky Way Milky Way | He/Him | March 15 |
|
|