<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.projectbasis.world/index.php?action=history&amp;feed=atom&amp;title=Module%3ACountryData%2Fdoc</id>
	<title>Module:CountryData/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.projectbasis.world/index.php?action=history&amp;feed=atom&amp;title=Module%3ACountryData%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://wiki.projectbasis.world/index.php?title=Module:CountryData/doc&amp;action=history"/>
	<updated>2026-07-22T06:14:57Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://wiki.projectbasis.world/index.php?title=Module:CountryData/doc&amp;diff=4423&amp;oldid=prev</id>
		<title>WillSysAd: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://wiki.projectbasis.world/index.php?title=Module:CountryData/doc&amp;diff=4423&amp;oldid=prev"/>
		<updated>2026-07-19T13:29:11Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:29, 19 July 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>WillSysAd</name></author>
	</entry>
	<entry>
		<id>https://wiki.projectbasis.world/index.php?title=Module:CountryData/doc&amp;diff=4422&amp;oldid=prev</id>
		<title>wikipedia&gt;Warudo: Added the page to :Category:Module documentation pages</title>
		<link rel="alternate" type="text/html" href="https://wiki.projectbasis.world/index.php?title=Module:CountryData/doc&amp;diff=4422&amp;oldid=prev"/>
		<updated>2024-08-29T20:58:17Z</updated>

		<summary type="html">&lt;p&gt;Added the page to &lt;a href=&quot;/index.php?title=Category:Module_documentation_pages&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Category:Module documentation pages (page does not exist)&quot;&gt;Category:Module documentation pages&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Module rating|protected}}&lt;br /&gt;
{{High-use}}&lt;br /&gt;
This module has three functions to extract data from [[:Category:Country data templates|country data templates]] (which are used for most [[WP:WPFT|flag templates]]).&lt;br /&gt;
&lt;br /&gt;
=== gettable ===&lt;br /&gt;
Extracts all parameters from a data template and returns them as a Lua table. This function is only usable from other Lua modules; invoke it using &amp;lt;code&amp;gt;require(&amp;#039;Module:CountryData&amp;#039;).gettable(&amp;#039;&amp;#039;parameters&amp;#039;&amp;#039;)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The first parameter is the &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt; of the invoking module; the second is the country or other entity to get the data of. The optional third parameter is a table of parameters to pass into the data template; this may, for example, include {{para|age}} or {{para|mw}}, which are used in the values of some sports alias parameters. E.g.,&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Lua&amp;quot;&amp;gt;local data = require(&amp;#039;Module:CountryData&amp;#039;).gettable(frame,&amp;quot;France&amp;quot;,{age=&amp;quot;20&amp;quot;,mw=&amp;quot;men&amp;#039;s&amp;quot;})&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function returns an empty table if a data template does not exist or does not conform to the [[WP:WPFT#Basic country data template structure|standard structure]].&lt;br /&gt;
&lt;br /&gt;
=== getalias ===&lt;br /&gt;
If used from wikicode, this function returns the value of a single field in a data template. The first parameter is the country or other entity whose data to return; the second is the name of the field. For example, &amp;lt;code&amp;gt;{{((}}#invoke:CountryData|getalias|France|flag alias{{))}}&amp;lt;/code&amp;gt; &amp;amp;rarr; {{#invoke:CountryData|getalias|France|flag alias}}. The other parameters are {{para|variant}} to return a variant parameter value, with fallback to the main field value if the variant does not exist, and {{para|def}} for the fallback output if the wanted data template or field does not exist, the default for which is a literal &amp;quot;nil&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note: This is likely not quicker than wikicode-only alternatives such as {{tl|getalias}} and {{tl|getalias2}}, because it transcludes the data template from Lua and converts it to a Lua table using the above function, picks the wanted parameter name, and returns it to wikicode, whereas other templates perform two simple non-Lua transclusions to get, in most cases, the same result. The Lua version does have the advantage that using it with a non-existing country data template returns &amp;quot;nil&amp;quot; (or the value of {{para|def}}) rather than a redlink to the data template. See a comparison of the four at [[User:SiBr4/Flagg tests#Lua-based getalias|User:SiBr&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;/Flagg tests#Lua-based getalias]].&lt;br /&gt;
&lt;br /&gt;
=== gettemplate ===&lt;br /&gt;
This function concatenates the fields of a data template into a string similar to what you get when transcluding it directly. It can be compared with a direct transclusion to test if a template is being converted to Lua correctly:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{#tag:pre|{{Country data France}}}}&lt;br /&gt;
{{#tag:pre|{{#invoke:CountryData|gettemplate|France}}}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
gives&lt;br /&gt;
{{#tag:pre|{{Country data France}}}}&lt;br /&gt;
{{#tag:pre|{{#invoke:CountryData|gettemplate|France}}}}&lt;br /&gt;
&lt;br /&gt;
Note that, like with all Lua tables, the order of entries is not preserved, so the parameters are mixed up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{Sandbox other | |&lt;br /&gt;
[[Category:Flag template system]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Module documentation pages]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>wikipedia&gt;Warudo</name></author>
	</entry>
</feed>