Jump to content
Toggle menu
  • 12,3 E szócikkek
  • 21,5 E fájlok
  • 4 felhasználók
  • 63,9 E szerkesztések
SCWIKI
Toggle preferences menu
Toggle personal menu
Nem vagy bejelentkezve
Your IP address will be publicly visible if you make any edits.

Renders an interactive, filterable browse table for every page in a category. Wraps Module:DataGrid; see the module page for query and rendering details.

Use it on overview pages (e.g. Personal weapon) to list every member of a category with a sortable, searchable, paginated table backed by Semantic MediaWiki data. A page image and the page name are added automatically as the first two columns; you only declare the data columns.

Usage

{{Data table
| category = Personal weapons
| columns =
    Size ; filter
    Subtype ; label=Type ; filter
    Class ; filter
    Ammo ; filter
    Effective range
    Maximum range ; label=Max range
    Muzzle velocity
    Damage
    Manufacturer ; filter
    Is item base variant ; label=Base variant ; filter
}}

Each non-blank line in columns is one column. The first ;-separated clause is the SMW property to show; the remaining clauses are modifiers:

Modifier Effect
label=X Override the column header (default: the property name).
filter Give the column a search-pane filter.
size=100px Format hint for image-valued properties.

Spacing around ; is optional: Size ; filter, Size; filter, and Size;filter are equivalent.

Parameters

Renders an interactive, filterable browse table for the pages in a category, matching an SMW condition, or both.

Sablonparaméterek

Ennek a sablonnak ajánlott külön sorokba (blokkban) írni a paramétereit

ParaméterLeírásTípusÁllapot
Categorycategory

Category whose member pages are listed. Do not include the Category: prefix. Provide this, conditions, or both.

Példa
Personal weapons
Karakterláncnem kötelező
Columnscolumns

One column per line. First clause is the SMW property; add ; label=X, ; filter, or ; size=X modifiers.

Példa
Size ; filter
Tartalomkötelező
Conditionsconditions

Extra raw SMW query conditions, appended to the category condition (or used alone when no category is given). Advanced: use to filter by an SMW property rather than category membership.

Példa
[[Manufacturer::ArcCorp]]
Karakterláncnem kötelező

At least one of category or conditions must be given. The query is always restricted to the main namespace.

Behavior

  • The page image (100px) and page name are always the first two columns and cannot be removed; you do not list them in columns.
  • All DataTables options (pagination at 10 rows, search panes, deferred render, horizontal scroll, highlight) are fixed by the module, so every browse table behaves identically.
  • Search-pane column indices are computed automatically from which columns carry filter. Reordering, adding, or removing columns never breaks the filters.
  • A query that matches nothing shows DataTables' built-in "No data available in table" message.

See also

  • Module:DataTableLua — implementation.
  • Module:TableLua — a different layer: renders a static table from data already in a module, with no query or client-side interactivity.