Jump to content

Template:Filter/Header: Difference between revisions

From The Petit Planet Wiki
Created Template:Filter/Header
 
Updated
Line 1: Line 1:
<includeonly>{{{message|Click on the buttons or type in the provided search box below to apply a filter to the list{{#if:{{{1|}}}|&nbsp;of {{{1}}}.|.}}}}}
<includeonly><div style="margin-top:1rem;">{{{message|Click on the '''buttons'''{{#ifeq:{{{no_search|}}}|1||&nbsp;or type in the provided '''search box'''}} below to apply a '''{{Color|New|filter}}''' to the list{{#if:{{{type|}}}|&nbsp;of {{{type}}}.|.}}}}}</div>
 
<div class="filter-wrapper" data-table-id="{{{table|}}}"></includeonly><noinclude>{{Documentation|type=Filter|content=
<div style="display:grid; text-align:center;"></includeonly><noinclude>
Template that creates instructions and the div container for {{T|Filter}}. To be used in conjunction with {{T|Filter/Footer}}.
Template that creates instructions and the div container for {{T|Filter}}. To be used in conjunction with {{T|Filter/Footer}}.


==Syntax==
==Syntax==
<pre>
<syntaxhighlight lang="wikitext" copy>
{{Filter/Header}}
{{Filter/Header|table=}}
<Filterable table>
<Filterable table>
{{Filter/Footer}}
{{Filter/Footer}}
</pre>
</syntaxhighlight>
This template has 1 unnamed paramter:
* {{F|table}} &mdash; Table ID of filterable table.
* <code>1</code> &mdash; Name of the filterable element
* {{F|type}} &mdash; Name of the filterable element.
* <code>message</code> &mdash; Customize the message
* {{F|no_search}} &mdash; Set to {{F|1}} to hide the search box message.
* {{F|message}} &mdash; Customize the message.


==Examples==
==Example==
=====Default=====
===Default===
<pre>{{Filter/Header}}
{{Example|<nowiki>
{{Filter/Footer}}</pre>
{{Filter/Header|table=example-1}}
{{Filter/Header}}
{{Filter/Footer|no_results=1|no_search=1|no_reset=1}}
{{Filter/Footer}}
</nowiki>}}


=====With filterable element=====
===With Filterable Element===
<pre>{{Filter/Header|neighbors}}
{{Example|<nowiki>
{{Filter/Footer}}</pre>
{{Filter/Header|table=example-2|no_search=1|type=neighbors}}
{{Filter/Header|neighbors}}
{{Filter/Footer|no_results=1|no_search=1|no_reset=1}}
{{Filter/Footer}}
</nowiki>}}
 
=====Custom message=====
<pre>{{Filter/Header|message=This is a custom message.}}
{{Filter/Footer}}</pre>
{{Filter/Header|message=This is a custom message.}}
{{Filter/Footer}}


[[Category:Filter Templates]]</noinclude>
===Custom Message===
{{Example|<nowiki>
{{Filter/Header|table=example-3|message=Click on the buttons or type in the provided search box below to apply a filter to the list of neighbors. For example, typing in {{F|Wildgrass}} (case insensitive) in the search box will show all the neighbors that have either an interest or disinterest in {{Item|Wildgrass}}.}}
{{Filter/Footer|no_results=1|no_search=1|no_reset=1}}
</nowiki>}}
}}

Revision as of 16:28, 8 May 2026

Template documentation
Note: parts of or the entire template might not be visible without values provided.

Template that creates instructions and the div container for {{Filter}}. To be used in conjunction with {{Filter/Footer}}.

Syntax

{{Filter/Header|table=}}
<Filterable table>
{{Filter/Footer}}
  • table — Table ID of filterable table.
  • type — Name of the filterable element.
  • no_search — Set to 1 to hide the search box message.
  • message — Customize the message.

Example

Default

{{Filter/Header|table=example-1}}
{{Filter/Footer|no_results=1|no_search=1|no_reset=1}}
Click on the buttons or type in the provided search box below to apply a filter to the list.

With Filterable Element

{{Filter/Header|table=example-2|no_search=1|type=neighbors}}
{{Filter/Footer|no_results=1|no_search=1|no_reset=1}}
Click on the buttons below to apply a filter to the list of neighbors.

Custom Message

{{Filter/Header|table=example-3|message=Click on the buttons or type in the provided search box below to apply a filter to the list of neighbors. For example, typing in {{F|Wildgrass}} (case insensitive) in the search box will show all the neighbors that have either an interest or disinterest in {{Item|Wildgrass}}.}}
{{Filter/Footer|no_results=1|no_search=1|no_reset=1}}
Click on the buttons or type in the provided search box below to apply a filter to the list of neighbors. For example, typing in Wildgrass (case insensitive) in the search box will show all the neighbors that have either an interest or disinterest in Wildgrass Wildgrass.