<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="uk">
	<id>https://wiki.dnd.in.ua/index.php?action=history&amp;feed=atom&amp;title=%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD%3AIfEmpty</id>
	<title>Шаблон:IfEmpty - Історія редагувань</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.dnd.in.ua/index.php?action=history&amp;feed=atom&amp;title=%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD%3AIfEmpty"/>
	<link rel="alternate" type="text/html" href="https://wiki.dnd.in.ua/index.php?title=%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:IfEmpty&amp;action=history"/>
	<updated>2026-05-02T22:53:34Z</updated>
	<subtitle>Історія редагувань цієї сторінки в вікі</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://wiki.dnd.in.ua/index.php?title=%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:IfEmpty&amp;diff=2249&amp;oldid=prev</id>
		<title>587: Імпортовано 1 версія</title>
		<link rel="alternate" type="text/html" href="https://wiki.dnd.in.ua/index.php?title=%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:IfEmpty&amp;diff=2249&amp;oldid=prev"/>
		<updated>2023-08-27T18:54:57Z</updated>

		<summary type="html">&lt;p&gt;Імпортовано 1 версія&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;uk&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Попередня версія&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версія за 21:54, 27 серпня 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;uk&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(Немає відмінностей)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>587</name></author>
	</entry>
	<entry>
		<id>https://wiki.dnd.in.ua/index.php?title=%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:IfEmpty&amp;diff=1070&amp;oldid=prev</id>
		<title>587: Створена сторінка: &lt;noinclude&gt;Accepts any number of parameters and returns the first value that's not empty.  The more correct name for this template would be &lt;code&gt;FirstNonEmpty&lt;/code&gt;, but most of the time you use it with two arguments, meaning that it either returns the first, or ''if that one is empty'' (hence &lt;code&gt;IfEmpty&lt;/code&gt;), the second.  You would typically use this while writing other templates, like so:  &lt;pre&gt; {{IfEmpty | {{{firstParameter|}}} | {{{secondParame...</title>
		<link rel="alternate" type="text/html" href="https://wiki.dnd.in.ua/index.php?title=%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:IfEmpty&amp;diff=1070&amp;oldid=prev"/>
		<updated>2023-08-25T10:55:30Z</updated>

		<summary type="html">&lt;p&gt;Створена сторінка: &amp;lt;noinclude&amp;gt;Accepts any number of parameters and returns the first value that&amp;#039;s not empty.  The more correct name for this template would be &amp;lt;code&amp;gt;FirstNonEmpty&amp;lt;/code&amp;gt;, but most of the time you use it with two arguments, meaning that it either returns the first, or &amp;#039;&amp;#039;if that one is empty&amp;#039;&amp;#039; (hence &amp;lt;code&amp;gt;IfEmpty&amp;lt;/code&amp;gt;), the second.  You would typically use this while writing other templates, like so:  &amp;lt;pre&amp;gt; {{IfEmpty | {{{firstParameter|}}} | {{{secondParame...&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;uk&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Попередня версія&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версія за 13:55, 25 серпня 2023&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-l30&quot;&gt;Рядок 30:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Рядок 30:&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;If you used a construct like &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{{firstParameter | {{{secondParameter|}}} }}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; in the definition of &amp;lt;code&amp;gt;MyOtherTemplate&amp;lt;/code&amp;gt;, this would essentially be an error, since the first parameter will always have a value, even if it's blank, and so the fallback to the second parameter will never trigger.&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;If you used a construct like &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{{firstParameter | {{{secondParameter|}}} }}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; in the definition of &amp;lt;code&amp;gt;MyOtherTemplate&amp;lt;/code&amp;gt;, this would essentially be an error, since the first parameter will always have a value, even if it's blank, and so the fallback to the second parameter will never trigger.&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;div&gt;&amp;lt;/noinclude&amp;gt;{{&amp;lt;includeonly&amp;gt;safesubst:&amp;lt;/includeonly&amp;gt;#invoke:IfEmpty|main}}&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;/noinclude&amp;gt;{{&amp;lt;includeonly&amp;gt;safesubst:&amp;lt;/includeonly&amp;gt;#invoke:IfEmpty|main}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Категорія:Потребує перекладу]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>587</name></author>
	</entry>
	<entry>
		<id>https://wiki.dnd.in.ua/index.php?title=%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:IfEmpty&amp;diff=2248&amp;oldid=prev</id>
		<title>bg3&gt;Taylan в 18:54, 23 липня 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.dnd.in.ua/index.php?title=%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:IfEmpty&amp;diff=2248&amp;oldid=prev"/>
		<updated>2023-07-23T18:54:33Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Нова сторінка&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;noinclude&amp;gt;Accepts any number of parameters and returns the first value that's not empty.  The more correct name for this template would be &amp;lt;code&amp;gt;FirstNonEmpty&amp;lt;/code&amp;gt;, but most of the time you use it with two arguments, meaning that it either returns the first, or ''if that one is empty'' (hence &amp;lt;code&amp;gt;IfEmpty&amp;lt;/code&amp;gt;), the second.&lt;br /&gt;
&lt;br /&gt;
You would typically use this while writing other templates, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{IfEmpty | {{{firstParameter|}}} | {{{secondParameter|}}} }}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this is almost but not quite equivalent to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{{firstParameter| {{{secondParameter|}}} }}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The difference is:&lt;br /&gt;
&lt;br /&gt;
In the second variant, if the user had explicitly provided a blank value for the first parameter, like &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{MyTemplate | firstParameter = | secondParameter = x }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; then it would '''not''' fall back to the value of the second parameter and instead return a blank.&lt;br /&gt;
&lt;br /&gt;
On the other hand, &amp;lt;code&amp;gt;IfEmpty&amp;lt;/code&amp;gt; doesn't care whether the template parameter was omitted entirely, or provided with a blank value, so in both cases it will fall back to the second parameter and give you &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This is particularly useful when one template passes optional parameters onto another one, which eliminates the distinction between &amp;quot;not provided&amp;quot; and &amp;quot;blank value&amp;quot; since it passes blank values for all non-provided parameters onto the second template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{MyOtherTemplate&lt;br /&gt;
| firstParameter = {{{firstParameter|}}}&lt;br /&gt;
| secondParameter = {{{secondParameter|}}}&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you used a construct like &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{{firstParameter | {{{secondParameter|}}} }}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; in the definition of &amp;lt;code&amp;gt;MyOtherTemplate&amp;lt;/code&amp;gt;, this would essentially be an error, since the first parameter will always have a value, even if it's blank, and so the fallback to the second parameter will never trigger.&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;{{&amp;lt;includeonly&amp;gt;safesubst:&amp;lt;/includeonly&amp;gt;#invoke:IfEmpty|main}}&lt;/div&gt;</summary>
		<author><name>bg3&gt;Taylan</name></author>
	</entry>
</feed>