<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://pool.calebcooper.ie/index.php?action=history&amp;feed=atom&amp;title=Template%3AIfnotempty</id>
	<title>Template:Ifnotempty - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pool.calebcooper.ie/index.php?action=history&amp;feed=atom&amp;title=Template%3AIfnotempty"/>
	<link rel="alternate" type="text/html" href="https://pool.calebcooper.ie/index.php?title=Template:Ifnotempty&amp;action=history"/>
	<updated>2026-04-10T13:17:41Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://pool.calebcooper.ie/index.php?title=Template:Ifnotempty&amp;diff=15218&amp;oldid=prev</id>
		<title>Caleb Cooper at 17:00, 2 November 2020</title>
		<link rel="alternate" type="text/html" href="https://pool.calebcooper.ie/index.php?title=Template:Ifnotempty&amp;diff=15218&amp;oldid=prev"/>
		<updated>2020-11-02T17:00:38Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;includeonly&amp;gt;{{ {{{|safesubst:}}}{{ {{{|safesubst:}}}#if:{{{1}}}|p1|p2}}|{{{2}}}|{{{3|}}}}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Documentation|content=&lt;br /&gt;
{{Commons Import}}&lt;br /&gt;
With this template [[mediawikiwiki:Help:Extension:ParserFunctions|#if]] can be used in a way such that it does not [[metawikimedia:Help:Newlines_and_spaces#Stripping_on_expansion|strip spaces and newlines]] from the &amp;quot;then&amp;quot; and &amp;quot;else&amp;quot; part. For evaluating the condition spaces and newlines are stripped like with ParserFunctions.&lt;br /&gt;
&lt;br /&gt;
This template can be substituted.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
*&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ifnotempty| x | A | B }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; gives &amp;quot;{{ifnotempty| x | A | B }}&amp;quot;&lt;br /&gt;
*&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ifnotempty|x| A | B }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; gives &amp;quot;{{ifnotempty|x| A | B }}&amp;quot;&lt;br /&gt;
*&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ifnotempty| | A | B }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; gives &amp;quot;{{ifnotempty| | A | B }}&amp;quot;&lt;br /&gt;
*&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ifnotempty|| A | B }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; gives &amp;quot;{{ifnotempty|| A | B }}&amp;quot;&lt;br /&gt;
Compare:&lt;br /&gt;
*&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#if:x| A | B }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; gives &amp;quot;{{#if:x| A | B }}&amp;quot;&lt;br /&gt;
*&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#if:| A | B }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; gives &amp;quot;{{#if:| A | B }}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Internal technical details==&lt;br /&gt;
For evaluating the condition (determining non-emptiness of the first parameter) the template uses parser function #if, producing 1 if the condition is true, and 2 otherwise. The template with name equal to &amp;quot;P&amp;quot; followed by the index value produced (hence [[Template:P1]] or [[Template:P2]]), is called with as parameters A and B. This produces either A or B, without trimming.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[Template:If]]&lt;br /&gt;
For more detail see wikipedia page [[metawikimedia:Template:Ifnotempty]]&lt;br /&gt;
&lt;br /&gt;
[[Category:If-then-else templates]]&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Caleb Cooper</name></author>
	</entry>
</feed>