<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.savez.net/history/Module:CountryData/doc?feed=atom</id>
	<title>Module:CountryData/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.savez.net/history/Module:CountryData/doc?feed=atom"/>
	<link rel="alternate" type="text/html" href="https://www.savez.net/history/Module:CountryData/doc"/>
	<updated>2026-05-07T00:08:26Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://www.savez.net/index.php?title=Module:CountryData/doc&amp;diff=1482&amp;oldid=prev</id>
		<title>BalkanMapper: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://www.savez.net/index.php?title=Module:CountryData/doc&amp;diff=1482&amp;oldid=prev"/>
		<updated>2023-07-26T20:37:39Z</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=&quot;interface&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 20:37, 26 July 2023&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>BalkanMapper</name></author>
	</entry>
	<entry>
		<id>https://www.savez.net/index.php?title=Module:CountryData/doc&amp;diff=1481&amp;oldid=prev</id>
		<title>ModuleCountryData&gt;Paine Ellsworth: /* getalias */ remove deleted template</title>
		<link rel="alternate" type="text/html" href="https://www.savez.net/index.php?title=Module:CountryData/doc&amp;diff=1481&amp;oldid=prev"/>
		<updated>2021-09-25T06:29:02Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;getalias: &lt;/span&gt; remove deleted template&lt;/span&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;
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;&lt;/div&gt;</summary>
		<author><name>ModuleCountryData&gt;Paine Ellsworth</name></author>
	</entry>
</feed>