Fandom

Wikia Developers Wiki

Global Lua Modules/Country

< Global Lua Modules

847pages on
this wiki
Add New Page
Talk6 Share

Gets data about a country.

Syntax

  • {{#invoke:country|main|country-isocode|<param2 see table below>}}
  • {{#invoke:country|main|country name|<param2 see table below>}}
  • {{#invoke:country|main|country-code|country name}}


Install

Installing modules

To get a brief introduction to lua read the basics page first. On Wikia, one can use modules by either accessing a module remotely or copying all its contents to a Wiki. Modules accessed remotely from dev.wikia are subject to change while 'correctly' copied modules are controlled by a particular wiki.

Using a module "remotely" using Module:Devmodule

Create Module:Devmodule and copy the following code to remotely access modules in dev's repository. See more details in Global Lua Modules/Devmodule.
--[[This imports modules from dev.wikia]]
return require("Dev:Devmodule")

Loading modules remotely from dev.wikia

Create Module:Country in your wiki and add the following code:
--This loads modules directly from dev.wikia.com
return require("Dev:Country")

Using Module:Country in another wiki

To use modules without depending on dev see this page. Create Template:Country in your wiki and add the following code:
{{#invoke:Country|main}}

Using template in a page

You can use this module in a page using syntax such as:
{{Country|main|arg1|arg2}}

Syntax options

Name Description Example output
alpha-2 2 letter country-code NZ
alpha-3 3 letter country-code NZL
country-code  country-code no. 554
sub-region-code sub-region-code 53
region-code region-code 9
iso_3166-2 Iso code ISO 3166-2:NZ
region region Oceania
sub-region sub-region name Australia and New Zealand

Example

CodeOutput
{{#invoke:Country|countrycode|france}}fr
CodeOutput
{{#invoke:Country|main|de|name}}Germany
CodeOutput
{{#invoke:Country|main|france|country-code}}250

See also

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.