<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://70.231.62.181/index.php?action=history&amp;feed=atom&amp;title=Module%3AIf_not_given_or_empty%2Fdoc</id>
	<title>Module:If not given or empty/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://70.231.62.181/index.php?action=history&amp;feed=atom&amp;title=Module%3AIf_not_given_or_empty%2Fdoc"/>
	<link rel="alternate" type="text/html" href="http://70.231.62.181/index.php?title=Module:If_not_given_or_empty/doc&amp;action=history"/>
	<updated>2026-04-22T11:53:55Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>http://70.231.62.181/index.php?title=Module:If_not_given_or_empty/doc&amp;diff=20108688&amp;oldid=prev</id>
		<title>imported&gt;Warudo: Added the page to :Category:Module documentation pages</title>
		<link rel="alternate" type="text/html" href="http://70.231.62.181/index.php?title=Module:If_not_given_or_empty/doc&amp;diff=20108688&amp;oldid=prev"/>
		<updated>2024-08-29T21:49:12Z</updated>

		<summary type="html">&lt;p&gt;Added the page to &lt;a href=&quot;/index.php/Category:Module_documentation_pages&quot; title=&quot;Category:Module documentation pages&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;This module&amp;#039;s &amp;#039;&amp;#039;check_parameter&amp;#039;&amp;#039; function checks whether a parameter is given, empty, or nonempty in a template call.&lt;br /&gt;
It is intended to be called from template definitions only, as &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;{{#invoke:If not given or empty|check_parameter|parameter name|before|after|when=NG EM NE|notgiven=|empty=|notempty=}}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This is similar to {{tlx|If then show|&amp;lt;nowiki&amp;gt;{{{parameter name|}}}&amp;lt;/nowiki&amp;gt;|...|before|after}}, but also checks if the parameter is *present* in the template call. This can be useful in the calls from a template to some existing templates, where the output depends on the three states of a parameter, as it does in {{tl|Location map}} for {{param|caption}}.&lt;br /&gt;
&lt;br /&gt;
The values before and after are added only for cases in which {{para|when}} contains the codes NG (for not given), EM (given but empty), NE (given and not empty).&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
Template {{tl|Infobox some thing}} has parameter {{param|image}}. When used on a page, the template can be called without the parameter, as in &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Infobox some thing|}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, or with the parameter, in which case the parameter can have no value (&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Infobox some thing|image=}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;) or some value (&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Infobox some thing|image=some value}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;). This module has different outputs depending on these three cases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:If not given or empty|check_parameter|image|before | after|when=EM|notgiven=[[Image:Red pog.svg|30px]]|empty=EMPTY|notempty=[[File:{{{image}}}|30px]]}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Infobox some thing|}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: final output is the equivalent of &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[[Image:Red pog.svg|30px]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. Text &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;before&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;after&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; is not added because &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;when&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; does not contain NG (for &amp;#039;&amp;#039;not given&amp;#039;&amp;#039;).&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Infobox some thing|image=}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: final output is &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;before EMPTY after&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. Text &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;before&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;after&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; is added because &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;when&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; contains EM (for &amp;#039;&amp;#039;empty&amp;#039;&amp;#039;).&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Infobox some thing|image=Green pog.svg}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: final output is the  equivalent of &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[[File:Green pog.svg|30px]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. Text &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;before&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;after&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; is not added because &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;when&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; does not contain NE (for &amp;#039;&amp;#039;not empty&amp;#039;&amp;#039;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{Sandbox other||&lt;br /&gt;
&amp;lt;!-- Categories below this line; interwikis at Wikidata --&amp;gt;&lt;br /&gt;
[[Category:If-then-else templates]]&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>imported&gt;Warudo</name></author>
	</entry>
</feed>