Template:Data Table Copy

From Zelda Wiki, the Zelda encyclopedia
Jump to navigation Jump to search

Purpose

Creates a copy of a {{Data Table}} located on another page.

Usage

Required ParametersAll Parameters
{{Data Table Copy
|fromPage= 
|storedAs= 
}}
{{Data Table Copy
|fromPage= 
|storedAs= 
|columns= 
|excludeColumns= 
|rowsWith= 
|rowsExcluding= 
|responsiveModeEnabled= 
}}
ParameterStatusDescription
fromPagerequiredThe name of the wiki page containing the data table to be copied.
storedAsrequiredThe internal name of the table to be copied, as specified by the storeAs parameter of Template:Data Table.
columnsoptionalA comma-separated list of columns to copy. If absent, all columns are copied.
excludeColumnsoptionalA comma-separated list of columns not to copy. If absent, all columns are copied. Ignored if columns is present.
rowsWithoptionalIf specified, only rows containing the given string will be copied. If absent, all rows are copied.
rowsExcludingoptionalIf specified, only rows which do not contain the given string will be copied.
responsiveModeEnabledoptionalData tables have a responsive "mobile-friendly" mode which by default is turned on when:
  • The template estimates the width of the widest row to be greater than 40 characters.
  • The table has less than 100 rows.
Responsive mode generates a lot of HTML and therefore cannot be used with excessively long tables due to the risk of exceeding $wgMaxArticleSize.
  • The page is in the main namespace.
Data tables are sometimes used in template and module documentation. Since these pages are not reader-facing, page loading speed matters more than mobile support.
Responsive mode can be forced on or off by setting this parameter to true or false, respectively.

Required property "paramOrder[ "collapse" ]" not found.

Examples

Copying the table from the example at Template:Data Table
Input
{{Data Table Copy
|fromPage= Template:Data Table
|storedAs= TMC Figurines
}}
Output
Figurine
Capless LinkAppears in-game as the player's chosen name.
Number
001
Description

A young boy who lives in Hyrule. He is close friends with Princess Zelda.

Subject(s)
Pictured
Figurine
Ezlo and LinkAppears in-game as the player's chosen name.
Number
002
Description

A young boy on a quest with Ezlo to restore the Four Sword.
With the sword's power, he hopes to remove the curse on Princess Zelda.

Subject(s)
Pictured
Figurine
Princess Zelda
Number
003
Description

A bright and cheery princess from Hyrule's royal family.
She loves to sneak out of the castle to visit her good friend, LinkAppears in-game as the player's chosen name..

Subject(s)
Pictured
FigurineNumberDescriptionSubject(s)Pictured
Princess Zelda
003

A bright and cheery princess from Hyrule's royal family.
She loves to sneak out of the castle to visit her good friend, LinkAppears in-game as the player's chosen name..

Categories Added

Using the columns parameter to copy specific columns
Input
{{Data Table Copy
|fromPage= Template:Data Table
|storedAs= TMC Figurines
|columns= Figurine, Description
}}
Output
Figurine
Capless LinkAppears in-game as the player's chosen name.
Description

A young boy who lives in Hyrule. He is close friends with Princess Zelda.

Figurine
Ezlo and LinkAppears in-game as the player's chosen name.
Description

A young boy on a quest with Ezlo to restore the Four Sword.
With the sword's power, he hopes to remove the curse on Princess Zelda.

Figurine
Princess Zelda
Description

A bright and cheery princess from Hyrule's royal family.
She loves to sneak out of the castle to visit her good friend, LinkAppears in-game as the player's chosen name..

FigurineDescription
Princess Zelda

A bright and cheery princess from Hyrule's royal family.
She loves to sneak out of the castle to visit her good friend, LinkAppears in-game as the player's chosen name..

Categories Added

If one or more specified columns do not exist, a warning is issued and all columns are returned.
Input
{{Data Table Copy
|fromPage= Template:Data Table
|storedAs= TMC Figurines
|columns= Figurine, Not a Column
}}
Output
Figurine
Capless LinkAppears in-game as the player's chosen name.
Number
001
Description

A young boy who lives in Hyrule. He is close friends with Princess Zelda.

Subject(s)
Pictured
Figurine
Ezlo and LinkAppears in-game as the player's chosen name.
Number
002
Description

A young boy on a quest with Ezlo to restore the Four Sword.
With the sword's power, he hopes to remove the curse on Princess Zelda.

Subject(s)
Pictured
Figurine
Princess Zelda
Number
003
Description

A bright and cheery princess from Hyrule's royal family.
She loves to sneak out of the castle to visit her good friend, LinkAppears in-game as the player's chosen name..

Subject(s)
Pictured
FigurineNumberDescriptionSubject(s)Pictured
Princess Zelda
003

A bright and cheery princess from Hyrule's royal family.
She loves to sneak out of the castle to visit her good friend, LinkAppears in-game as the player's chosen name..

Categories Added

Using rowsWith to copy rows containing a certain string, and using excludeColumns to prevent certain columns from being copied.

Note that a Link figurine is returned as the description mentions the word "Zelda".

Input
{{Data Table Copy
|fromPage= Template:Data Table
|storedAs= TMC Figurines
|rowsWith= Zelda
|excludeColumns= Subject(s), Pictured
}}
Output
Figurine
Capless LinkAppears in-game as the player's chosen name.
Number
001
Description

A young boy who lives in Hyrule. He is close friends with Princess Zelda.

Figurine
Ezlo and LinkAppears in-game as the player's chosen name.
Number
002
Description

A young boy on a quest with Ezlo to restore the Four Sword.
With the sword's power, he hopes to remove the curse on Princess Zelda.

Figurine
Princess Zelda
Number
003
Description

A bright and cheery princess from Hyrule's royal family.
She loves to sneak out of the castle to visit her good friend, LinkAppears in-game as the player's chosen name..

FigurineNumberDescription
Princess Zelda
003

A bright and cheery princess from Hyrule's royal family.
She loves to sneak out of the castle to visit her good friend, LinkAppears in-game as the player's chosen name..

Categories Added

The rowsWith and rowsExcluding parameters accept Lua patterns. This is particularly useful for doing exact matches with ^ (string beginning) and $ (string ending).
Input
{{Data Table Copy
|fromPage= Template:Data Table
|storedAs= TMC Figurines
|rowsWith= ^Princess Zelda$
|excludeColumns= Subject(s), Pictured
}}
Output
Figurine
Princess Zelda
Number
003
Description

A bright and cheery princess from Hyrule's royal family.
She loves to sneak out of the castle to visit her good friend, LinkAppears in-game as the player's chosen name..

FigurineNumberDescription
Princess Zelda
003

A bright and cheery princess from Hyrule's royal family.
She loves to sneak out of the castle to visit her good friend, LinkAppears in-game as the player's chosen name..

Categories Added

Using the rowsExcluding to copy all rows except those containing a certain string
Input
{{Data Table Copy
|fromPage= Template:Data Table
|storedAs= TMC Figurines
|rowsExcluding= Zelda
|excludeColumns= Subject(s), Pictured
}}
Output
Categories Added

Using the As tag to rename a column
Input
{{Data Table Copy
|fromPage= Monster Part
|storedAs= Monster Parts
|columns= Monster Part [As:Material], Sell Price [Colspan:2], Rupees, Mon
|rowsWith= Ancient
}}
Output
MaterialRupeesMon
  • 80 Rupees
Categories Added

Error: Table not found
Input
{{Data Table Copy
|fromPage= Not a Page
|storedAs= Not a Table
}}
Output
Categories Added

Error: No matching rows found
Input
{{Data Table Copy
|fromPage= Template:Data Table
|storedAs= SS Upgrades
|rowsWith= invalid row query
}}
Output
Categories Added
The above documentation is transcluded from Template:Data Table Copy/Documentation. (edit | history)