Zelda Wiki

Want to contribute to this wiki?
Sign up for an account, and get started!

Come join the Zelda Wiki community Discord server!

READ MORE

Zelda Wiki
Advertisement

This is the documentation page for Module:Franchise

Lua interface for Data:Franchise.

This is the main module for the following templates:

In addition, this module exports the following functions.

Template functions

Article

{{#invoke:Franchise|Article|<game>|nowarn=}}

Parameters

ParameterStatusDescription
1gamerequiredThe code for a game or other entry in Data:Franchise.
nowarnoptional

If present, the template will not issue an editor warning when game is invalid. Use this when a template needs custom error handling (see examples).

However, an editor warning will still be issued if a game code is written with incorrect casing (e.g. oot instead of OoT)

Examples

#InputResultCategories added
1
{{#invoke:Franchise|Article|OoT}}
The Legend of Zelda: Ocarina of Time
2
{{#invoke:Franchise|Article|OoT (Himekawa)}}
The Legend of Zelda: Ocarina of Time (Himekawa)
Error handling
3
{{#invoke:Franchise|Article|oot}}
The Legend of Zelda: Ocarina of Time
4
{{#invoke:Franchise|Article|notAGame}}
Error: Invalid entry notAGame
5
{{#invoke:Franchise|Article|}}
Error: No game provided
6
{{#iferror:{{#invoke:Franchise|Article|invalid game}}|custom error handling}}
custom error handling

BaseGame

{{#invoke:Franchise|BaseGame|<game>|nowarn=}}

Parameters

ParameterStatusDescription
1gamerequiredThe code for a game entry in Data:Franchise.
nowarnoptional

If present, the template will not issue an editor warning when game is invalid. Use this when a template needs custom error handling (see examples).

However, an editor warning will still be issued if a game code is written with incorrect casing (e.g. oot instead of OoT)

Examples

#InputResultCategories added
7
{{#invoke:Franchise|BaseGame|TWW}}
Error: Invalid entry TWW
8
{{#invoke:Franchise|BaseGame|TWWHD}}
TWW
Error handling
9
{{#invoke:Franchise|BaseGame|notAGame}}
Error: Invalid entry notAGame
10
{{#invoke:Franchise|BaseGame|twwhd}}
TWW
11
{{#invoke:Franchise|BaseGame|}}
Error: No game provided
12
{{#iferror:{{#invoke:Franchise|BaseGame|invalid game}}|custom error handling}}
custom error handling

Display

{{#invoke:Franchise|Display|<game>|nowarn=}}

Parameters

ParameterStatusDescription
1gamerequiredThe code for a game or other Zelda-related title defined at Data:Franchise.
nowarnoptional

If present, the template will not issue an editor warning when game is invalid. Use this when a template needs custom error handling (see examples).

However, an editor warning will still be issued if a game code is written with incorrect casing (e.g. oot instead of OoT)

Examples

#InputResultCategories added
13
{{#invoke:Franchise|Display|LA}}
Link's Awakening
14
{{#invoke:Franchise|Display|LANS}}
Link's Awakening for Nintendo Switch
15
{{#invoke:Franchise|Display|LA (Cagiva)}}
Link's Awakening (Cagiva)
16
{{#invoke:Franchise|Display|invalid game}}
Error: Invalid entry invalid game
17
{{#invoke:Franchise|Display|}}
Error: No game provided

Link

{{#invoke:Franchise|Link|<game>|nowarn=}}

Parameters

ParameterStatusDescription
1gamerequiredThe code for a game or other Zelda-related title defined at Data:Franchise.
nowarnoptional

If present, the template will not issue an editor warning when game is invalid. Use this when a template needs custom error handling (see examples).

However, an editor warning will still be issued if a game code is written with incorrect casing (e.g. oot instead of OoT)

Examples

#InputResultCategories added
18
{{#invoke:Franchise|Link|OoT}}
Ocarina of Time
19
{{#invoke:Franchise|Link|OoT (Himekawa)}}
Ocarina of Time (Himekawa)
Error handling
20
{{#invoke:Franchise|Link|oot}}
Ocarina of Time
21
{{#invoke:Franchise|Link|notAGame}}
Error: Invalid entry notAGame
22
{{#invoke:Franchise|Link|}}
Error: No game provided
23
{{#iferror:{{#invoke:Franchise|Link|invalid game}}|custom error handling}}
custom error handling

ShortName

{{#invoke:Franchise|ShortName|<game>|nowarn=}}

Parameters

ParameterStatusDescription
1gamerequiredThe code for a game or other Zelda-related title defined at Data:Franchise.
nowarnoptional

If present, the template will not issue an editor warning when game is invalid. Use this when a template needs custom error handling (see examples).

However, an editor warning will still be issued if a game code is written with incorrect casing (e.g. oot instead of OoT)

Examples

#InputResultCategories added
24
{{#invoke:Franchise|ShortName|OoT}}
Ocarina of Time
25
{{#invoke:Franchise|ShortName|OoT (Himekawa)}}
Ocarina of Time (Himekawa)
26
{{#invoke:Franchise|ShortName|E}}
Encyclopedia
Error handling
27
{{#invoke:Franchise|ShortName|oot}}
Ocarina of Time
28
{{#invoke:Franchise|ShortName|notAGame}}
Error: Invalid entry notAGame
29
{{#invoke:Franchise|ShortName|}}
Error: No game provided
Custom error handling
30
{{#iferror:{{#invoke:Franchise|ShortName|invalid game}}|[[Dodongo]]|[[Dodongo#{{#invoke:Franchise|ShortName|invalid game}}]]}}
Dodongo
31
{{#iferror:{{#invoke:Franchise|ShortName|oot}}|[[Dodongo]]|[[Dodongo#{{#invoke:Franchise|ShortName|oot}}]]}}
Dodongo#Ocarina of Time
32
{{#iferror:{{#invoke:Franchise|ShortName|OoT}}|[[Dodongo]]|[[Dodongo#{{#invoke:Franchise|ShortName|OoT}}]]}}
Dodongo#Ocarina of Time


Module functions - all media

enum

enum(options)

See also enumGames.

Returns

Examples

#InputOutputStatus
33
local enum = Franchise.enum()
return utilsTable.take(enum, 10)
{
  "TLoZ",
  "TAoL",
  "ALttP",
  "LA",
  "LADX",
  "LANS",
  "OoT",
  "OoT3D",
  "MM",
  "MM3D",
}
Green check
34
return Franchise.enum().reference
"[[Data:Franchise]]"
Green check
When includeSeries is true, then Series is the first item in the enum.
35
local enum = Franchise.enum({
  includeSeries = true,
})
return utilsTable.take(enum, 3)
{"Series", "TLoZ", "TAoL"}
Green check
When includeNonfiction is true, then books such as Encyclopedia are in the list.
36
local enum = Franchise.enum({
  includeNonfiction = true,
})
return utilsTable.includes(enum, "E")
true
Green check
When includeGroups is true, then collective terms such as A Link to the Past & Four Swords are included in the list.
37
local enum = Franchise.enum({
  includeGroups = true,
})
return utilsTable.includes(enum, "ALttP&FS")
true
Green check

article

article(code)

Returns

  • Wiki article name for the title

Examples

#InputOutputStatus
38
article("LA")
"The Legend of Zelda: Link's Awakening"
Green check
39
article("la")
"The Legend of Zelda: Link's Awakening"
Green check
40
article("LANS")
"The Legend of Zelda: Link's Awakening (Nintendo Switch)"
Green check
41
article("TAoL")
"Zelda II: The Adventure of Link"
Green check
42
article("TLoZ")
"The Legend of Zelda"
Green check
43
article("Series")
"The Legend of Zelda (Series)"
Green check
44
article("E")
"The Legend of Zelda: Encyclopedia"
Green check
45
article("SSB4")
"Super Smash Bros. for Nintendo 3DS / Wii U"
Green check

canonicity

canonicity(code)

Returns

  • A string: canon, ambiguous, or non-canon.

Examples

#InputOutputStatus
46
canonicity("LA")
"canon"
Green check
47
canonicity("la")
"canon"
Green check
48
canonicity("CoH")
"ambiguous"
Green check
49
canonicity("LA (Cagiva)")
"non-canon"
Green check
50
canonicity("E")
"canon"
Green check
51
canonicity("fake")
nil
Green check

code

code(code)

Returns

  • The same code but correctly formatted, or nil if no such code exists

Examples

#InputOutputStatus
52
code("alttp")
"ALttP"
Green check
53
code("fakegame")
nil
Green check

display

display(code)

Returns

  • Formatted text for the title.

Examples

#InputOutputResultStatus
54
display("LA")
"''Link's Awakening''"
Link's Awakening
Green check
55
display("la")
"''Link's Awakening''"
Link's Awakening
Green check
56
display("LANS")
"''Link's Awakening'' for Nintendo Switch"
Link's Awakening for Nintendo Switch
Green check
57
display("E")
"''Encyclopedia''"
Encyclopedia
Green check
58
display("ALttP&FS")
"''A Link to the Past & Four Swords''"
A Link to the Past & Four Swords
Green check
59
display("Series")
"''The Legend of Zelda'' series"
The Legend of Zelda series
Green check
60
display("fakeGame")
nil
Green check

isCanon

isCanon(code)

Returns

  • True if title is canon, else false.

Examples

#InputOutputResult
61
isCanon("LANS")
true
Green check
62
isCanon("lans")
true
Green check
63
isCanon("CoH")
false
Green check
64
isCanon("SSBU")
false
Green check
65
isCanon("E")
true
Green check
66
isCanon("Series")
true
Green check

link

link(code)

Returns

  • Formatted link used in infoboxes and so on.

Examples

#InputOutputResultStatus
67
link("LA")
"''[[The Legend of Zelda: Link's Awakening|Link's Awakening]]''"
Link's Awakening
Green check
68
link("la")
"''[[The Legend of Zelda: Link's Awakening|Link's Awakening]]''"
Link's Awakening
Green check
69
link("LADX")
"''[[The Legend of Zelda: Link's Awakening DX|Link's Awakening DX]]''"
Link's Awakening DX
Green check
70
link("LANS")
"[[The Legend of Zelda: Link's Awakening (Nintendo Switch)|''Link's Awakening'' for Nintendo Switch]]"
Link's Awakening for Nintendo Switch
Green check
For books, comics and manga, see also phraseLink.
71
link("LA (Cagiva)")
"[[The Legend of Zelda: Link's Awakening (Cagiva)|''Link's Awakening'' (Cagiva)]]"
Link's Awakening (Cagiva)
Green check
72
link("E")
"''[[The Legend of Zelda: Encyclopedia|Encyclopedia]]''"
Encyclopedia
Green check
73
link("ALttP&FS")
"''[[The Legend of Zelda: A Link to the Past & Four Swords|A Link to the Past & Four Swords]]''"
A Link to the Past & Four Swords
Green check
74
link("Series")
"[[The Legend of Zelda (Series)|''The Legend of Zelda'' series]]"
The Legend of Zelda series
Green check
75
link("fakeGame")
nil
Green check

logo(code)

Returns

  • Filename for the title's logo.

Examples

#InputOutputResultStatus
76
logo("TWW")
"File:TWW English Logo.png"
File:TWW English Logo.png
Green check
77
logo("tww")
"File:TWW English Logo.png"
File:TWW English Logo.png
Green check
78
logo("E")
"File:The Legend of Zelda Encyclopedia Cover.png"
File:The Legend of Zelda Encyclopedia Cover.png
Green check
79
logo("Series")
"File:Zelda Logo TP.png"
File:Zelda Logo TP.png
Green check
80
logo("fakeGame")
nil
Green check

releaseDate

releaseDate(code)

Returns

  • The "main" release date for a title.

Examples

#InputOutputStatus
81
releaseDate("LA")
"1993-08-06"
Green check
82
releaseDate("LANS")
"2019-09-20"
Green check
83
releaseDate("LA (Cagiva)")
"1994-05-01"
Green check
84
releaseDate("E")
"2018-06-19"
Green check
85
releaseDate("ALttP&FS")
"2002-12-02"
Green check
86
releaseDate("Series")
""
87
releaseDate("fakeGame")
""

shortName

shortName(code)

Returns

  • Short name for franchise title used in category names. Usually the subtitle.

Examples

#InputOutputResultStatus
88
shortName("LA")
"Link's Awakening"
Link's Awakening
Green check
89
shortName("la")
"Link's Awakening"
Link's Awakening
Green check
90
shortName("LANS")
"Link's Awakening (Nintendo Switch)"
Link's Awakening (Nintendo Switch)
Green check
91
shortName("LA (Cagiva)")
"Link's Awakening (Cagiva)"
Link's Awakening (Cagiva)
Green check
92
shortName("E")
"Encyclopedia"
Encyclopedia
Green check
93
shortName("ALttP&FS")
"A Link to the Past & Four Swords"
A Link to the Past & Four Swords
Green check
94
shortName("Series")
"The Legend of Zelda Series"
The Legend of Zelda Series
Green check
95
shortName("fakeGame")
nil
Green check


Module functions - games

type

type(code)

Returns

  • One of: "main", "remake", "spin-off", "" (other games)

Examples

#InputOutputResultStatus
96
type("BotW")
"main"
main
Green check
97
type("HWAoC")
"spin-off"
spin-off
Green check
98
type("SSBU")
Expected
""
Actual
nil
TFH Red Link desperate

enumGames

enumGames(includeSeries)

Returns

Examples

#InputOutputStatus
99
local enum = Franchise.enumGames()
return utilsTable.slice(enum, 18, 20)
{"TMC", "TP", "TPHD"}
Green check
100
return Franchise.enumGames().reference
"[[Data:Franchise]]"
Green check
When includeSeries is true, then Series is the first item in the enum.
101
local enum = Franchise.enumGames(true)
return utilsTable.take(enum, 3)
{"Series", "TLoZ", "TAoL"}
Green check

baseGame

baseGame(code)

Returns

  • If code is a remake, returns the code for the original game, else returns code as-is.

Examples

#InputOutputStatus
102
baseGame("LANS")
"LA"
Green check
103
baseGame("LA")
Expected
"LA"
Actual
nil
TFH Red Link desperate
104
baseGame("fake")
nil
Green check

family

family(code)

Returns

  • A grouping name used for certain non-canon games on the Main Page.

Examples

#InputOutputStatus
105
family("OoT")
""
Green check
106
family("LCT")
""
Green check
107
family("FPTRR")
"Tingle"
Green check
108
family("HWDE")
"Hyrule Warriors"
Green check

graphics

graphics(code)

Returns

  • A string: 2D or 3D.

Examples

#InputOutputStatus
109
graphics("LA")
"2D"
Green check
110
graphics("la")
"2D"
Green check
111
graphics("LANS")
"3D"
Green check
112
graphics("fake")
nil
Green check

hasRemakes

hasRemakes(code)

Returns

  • True if game has at least one remake, remaster, or enhanced port. Else false.

Examples

#InputOutputResult
113
hasRemakes("LA")
true
Green check
114
hasRemakes("LADX")
true
Green check
115
hasRemakes("ST")
false
Green check
116
hasRemakes("fakeGame")
false
Green check

isRemake

isRemake(code)

Returns

  • True if game is a remake, remaster, or enhanced port. Else false.

Examples

#InputOutputResult
117
isRemake("LANS")
true
Green check
118
isRemake("LADX")
true
Green check
119
isRemake("LA")
false
Green check

remakes

remakes(code)

Returns

  • List of remakes for a specific game, or a table of all remakes if no game specified

Examples

#InputOutputResult
120
remakes("LA")
{"LADX", "LANS"}
Green check
121
remakes("LADX")
{"LANS"}
Green check
122
remakes("ST")
{}
Green check
123
remakes("fake")
{}
Green check


Module functions - books

publisher

publisher(code)

Returns

  • The book's publisher - in North America if available.

Examples

#InputOutputResultStatus
124
publisher("OoT (Himekawa)")
"VIZ Media"
VIZ Media
Green check
125
publisher("E")
"Dark Horse Books"
Dark Horse Books
Green check

phraseLink

phraseLink(code)

Returns

  • Formatted link to page and authors.

Examples

#InputOutputResultStatus
126
phraseLink("TLoZ (Ran)")
"[[The Legend of Zelda (Ran)|''The Legend of Zelda'' manga]] by [[Maru Ran]]"
The Legend of Zelda manga by Maru Ran
Green check
127
phraseLink("tloz (ran)")
"[[The Legend of Zelda (Ran)|''The Legend of Zelda'' manga]] by [[Maru Ran]]"
The Legend of Zelda manga by Maru Ran
Green check
128
phraseLink("AOV")
"''[[The Legend of Zelda: An Original Version|The Legend of Zelda: An Original Version]]''"
The Legend of Zelda: An Original Version
Green check
129
phraseLink("fake")
nil
Green check
Nonfiction books such as Encyclopedia are not included in this.
130
phraseLink("E")
nil
Green check
Advertisement