Widget:Tabla filtro

De Guild Wars 2 Wiki
Ir a la navegaciónIr a la búsqueda

Description

This widget provides filter buttons above tables, and will allow table content to be filtered by CSS classes applied to rows.

Parameters

id
Required. The "id" attribute of the table to target with the widget
filters
A comma separated list of classes to filter for.
Optional: Use a broken-pipe symbol to display a different button text to the underlying value, e.g. value1¦displayname1, value2¦displayname2
Optional: Use wikicode in the button display text, including icons - sorry no commas.
Optional: A value of <br> will instead insert a newline.
Optional: A value of label¦displayname will instead insert a label.
mode
Optional. Defaults to "AND", which uses AND logic to connect filters.
Can be set to "OR" to use OR logic to join the filter buttons with OR logic instead.
Can also be set to "ONLY" logic to only allow one active filter at a time.
content
Optional, visual parameter. Adjusts the text displayed in the sentence "The <content (default: "tabla")> below can be filtered using the following buttons." Could be used to set the text to "list".
position
Optional, visual parameter. Adjusts the text displayed in the sentence "The table <position (default: "abajo")> can be filtered using the following buttons." Could be used to set the text to "above".

Filter attributes

data-filter-id
Used in table header (<table>), list header (<ul>) or block header (<div>) to match the parameter "id" specified in the {{filter table|id=<id>}}.

Filter classes

filter-row
Used in tables, sets display: table-row.
filter-list
Used in lists, sets display: list-item.
filter-plain
Used in blocks, sets display: block.

Notes

  • This widget should be used via Template:Tabla filtro so that its usage can be tracked.
  • Incompatible with tables with the "collapsible" or "expandable" classes. Use "mw-collapsible" instead.

Example

AND
{{Tabla filtro|id=table1|filtros=JcE,WvW,PvP|mode=AND}}
{| data-filter-id="table1" class="wikitable"
! Heading one
! Heading two

|- class="filter-row WvW"
| Power wvw
| Precision wvw

|- class="filter-row JcE"
| Power jce
| Precision jce

|- class="filter-row PvP"
| Condition damage pvp
| Ferocity pvp

|- class="filter-row JcE WvW"
| Power jce 2 + wvw
| Precision jce 2 + wvw

|- class="filter-row PvP"
| Condition damage pvp 2
| Ferocity pvp 2
|}

Heading one Heading two
Power wvw Precision wvw
Power jce Precision jce
Condition damage pvp Ferocity pvp
Power jce 2 + wvw Precision jce 2 + wvw
Condition damage pvp 2 Ferocity pvp 2

OR
{{Tabla filtro|id=table2|filtros=JcE,WvW,PvP|mode=OR}}
{| data-filter-id="table2" class="wikitable"
! Heading one
! Heading two

|- class="filter-row WvW"
| Power wvw
| Precision wvw

|- class="filter-row JcE"
| Power jce
| Precision jce

|- class="filter-row PvP"
| Condition damage pvp
| Ferocity pvp

|- class="filter-row JcE WvW"
| Power jce 2 + wvw
| Precision jce 2 + wvw

|- class="filter-row PvP"
| Condition damage pvp 2
| Ferocity pvp 2
|}

Heading one Heading two
Power wvw Precision wvw
Power jce Precision jce
Condition damage pvp Ferocity pvp
Power jce 2 + wvw Precision jce 2 + wvw
Condition damage pvp 2 Ferocity pvp 2

ONLY
{{Tabla filtro|id=table3|filtros=JcE,WvW,PvP|mode=ONLY}}
{| data-filter-id="table3" class="wikitable"
! Heading one
! Heading two

|- class="filter-row WvW"
| Power wvw
| Precision wvw

|- class="filter-row JcE"
| Power jce
| Precision jce

|- class="filter-row PvP"
| Condition damage pvp
| Ferocity pvp

|- class="filter-row JcE WvW"
| Power jce 2 + wvw
| Precision jce 2 + wvw

|- class="filter-row PvP"
| Condition damage pvp 2
| Ferocity pvp 2
|}

Heading one Heading two
Power wvw Precision wvw
Power jce Precision jce
Condition damage pvp Ferocity pvp
Power jce 2 + wvw Precision jce 2 + wvw
Condition damage pvp 2 Ferocity pvp 2