<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.rpg.net/index.php?action=history&amp;feed=atom&amp;title=Template_talk%3AIfEmpty</id>
	<title>Template talk:IfEmpty - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.rpg.net/index.php?action=history&amp;feed=atom&amp;title=Template_talk%3AIfEmpty"/>
	<link rel="alternate" type="text/html" href="https://wiki.rpg.net/index.php?title=Template_talk:IfEmpty&amp;action=history"/>
	<updated>2026-07-30T21:02:06Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://wiki.rpg.net/index.php?title=Template_talk:IfEmpty&amp;diff=266487&amp;oldid=prev</id>
		<title>MattKendall at 19:01, 1 July 2014</title>
		<link rel="alternate" type="text/html" href="https://wiki.rpg.net/index.php?title=Template_talk:IfEmpty&amp;diff=266487&amp;oldid=prev"/>
		<updated>2014-07-01T19:01:17Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:01, 1 July 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l3&quot;&gt;Line 3:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;nowiki&amp;gt;{{IfEmpty|{{{NameOfKey}}}=text that should appear when NameOfKey is empty|text that should appear when NameOfKey has a value}}&amp;lt;/nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;nowiki&amp;gt;{{IfEmpty|{{{NameOfKey}}}=text that should appear when NameOfKey is empty|text that should appear when NameOfKey has a value}}&amp;lt;/nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This logic works because IfEmpty outputs a single parameter, which is the empty string. If it is not present, then it outputs the first non-named parameter. The trick is that we pass through the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;**&lt;/del&gt;value&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;** &lt;/del&gt;of the key that we want to analyze as a named parameter. So when the key has an empty value, you get:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This logic works because IfEmpty outputs a single parameter, which is the empty string. If it is not present, then it outputs the first non-named parameter. The trick is that we pass through the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&lt;/ins&gt;value&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039; &lt;/ins&gt;of the key that we want to analyze as a named parameter. So when the key has an empty value, you get:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{|&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{|&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l24&quot;&gt;Line 24:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 24:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The only further trick is that every key used this way must be defined in the template. If it&#039;s not present, then the trick doesn&#039;t work.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The only further trick is that every key used this way must be &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&lt;/ins&gt;defined&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039; &lt;/ins&gt;in the template. If it&#039;s not present, then the trick doesn&#039;t work&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. So just define every key, but leave the ones that you aren&#039;t using blank, and IfEmpty will work well&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>MattKendall</name></author>
	</entry>
	<entry>
		<id>https://wiki.rpg.net/index.php?title=Template_talk:IfEmpty&amp;diff=266482&amp;oldid=prev</id>
		<title>MattKendall: Created page with &quot;Since wiki.rpg.new does not support the #if statement, this template provides &quot;if like&quot; functionality using a trick in the template engine. To utilize this template, type:  &lt;n...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.rpg.net/index.php?title=Template_talk:IfEmpty&amp;diff=266482&amp;oldid=prev"/>
		<updated>2014-07-01T19:00:03Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Since wiki.rpg.new does not support the #if statement, this template provides &amp;quot;if like&amp;quot; functionality using a trick in the template engine. To utilize this template, type:  &amp;lt;n...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Since wiki.rpg.new does not support the #if statement, this template provides &amp;quot;if like&amp;quot; functionality using a trick in the template engine. To utilize this template, type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;{{IfEmpty|{{{NameOfKey}}}=text that should appear when NameOfKey is empty|text that should appear when NameOfKey has a value}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This logic works because IfEmpty outputs a single parameter, which is the empty string. If it is not present, then it outputs the first non-named parameter. The trick is that we pass through the **value** of the key that we want to analyze as a named parameter. So when the key has an empty value, you get:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|=text that should appear when NameOfKey is empty&lt;br /&gt;
|-&lt;br /&gt;
|1=text that should appear when NameOfKey has a value&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Because the empty string key is present, &amp;#039;text that should appear when NameOfKey is empty&amp;#039; is outputted. However, if NameOfKey has a value, then IfEmpty is called with:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|the value stored in NameOfKey=text that should appear when NameOfKey is empty&lt;br /&gt;
|-&lt;br /&gt;
|1=text that should appear when NameOfKey has a value&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Because the empty string key is now missing, we output &amp;#039;text that should appear when NameOfKey has a value&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The only further trick is that every key used this way must be defined in the template. If it&amp;#039;s not present, then the trick doesn&amp;#039;t work.&lt;/div&gt;</summary>
		<author><name>MattKendall</name></author>
	</entry>
</feed>