<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://wiki.undertensai.cn/index.php?action=history&amp;feed=atom&amp;title=%E6%A8%A1%E6%9D%BF%3AIfnotempty</id>
	<title>模板:Ifnotempty - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.undertensai.cn/index.php?action=history&amp;feed=atom&amp;title=%E6%A8%A1%E6%9D%BF%3AIfnotempty"/>
	<link rel="alternate" type="text/html" href="https://wiki.undertensai.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Ifnotempty&amp;action=history"/>
	<updated>2026-11-17T03:54:05Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://wiki.undertensai.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Ifnotempty&amp;diff=26929&amp;oldid=prev</id>
		<title>2024年6月29日 (六) 01:21 wiki&gt;Pppery</title>
		<link rel="alternate" type="text/html" href="https://wiki.undertensai.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Ifnotempty&amp;diff=26929&amp;oldid=prev"/>
		<updated>2024-06-29T01:21:40Z</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;includeonly&amp;gt;{{{{{|safesubst:}}}{{{{{|safesubst:}}}#if:{{{1}}}|p1|p2}}|{{{2}}}|{{{3|}}}}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation|content=&lt;br /&gt;
With this template [[mw:Help:Extension:ParserFunctions|#if]] can be used in a way such that it does not [[Help:Newlines_and_spaces#Trimming_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;
==Usage==&lt;br /&gt;
*&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ifnotempty|x| p | q }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; gives &amp;quot;{{ifnotempty|x| p | q }}&amp;quot;&lt;br /&gt;
*&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ifnotempty|| p | q }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; gives &amp;quot;{{ifnotempty|| p | q }}&amp;quot;&lt;br /&gt;
Compare:&lt;br /&gt;
*&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#if:x| p | q }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; gives &amp;quot;{{#if:x| p | q }}&amp;quot;&lt;br /&gt;
Note that, unlike parser functions, templates require writing equals signs in values of unnamed parameters as &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{=}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For full substitution, simply use {{cnw|subst:}} or {{cnw|safesubst:}}. If the condition contains a parser function, template, or variable, that should be substituted too. Optionally the &amp;quot;then&amp;quot; or &amp;quot;else&amp;quot; part can also be substituted.&lt;br /&gt;
&lt;br /&gt;
==Expansion depth limit==&lt;br /&gt;
13 levels allowed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|a}}}}}}}}}}}}}}}}}}}}}}}}}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; gives {{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|a}}}}}}}}}}}}}}}}}}}}}}}}}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|a}}}}}}}}}}}}}}}}}}}}}}}}}}}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; gives {{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|{{ifnotempty|x|a}}}}}}}}}}}}}}}}}}}}}}}}}}}}&lt;br /&gt;
&lt;br /&gt;
==Internal technical details==&lt;br /&gt;
For evaluating the condition the template uses the actual parser function; however, not directly with p and q, because this strips spaces and newlines from the result, but with index values 1 and 2. The result can be 1, 2. The template with the applicable name is called ([[Template:P1]] or  [[Template:P2]]), with as parameters p and q.&lt;br /&gt;
&lt;br /&gt;
==Conditions==&lt;br /&gt;
===#if:===&lt;br /&gt;
&lt;br /&gt;
Condition: string not empty.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[Template:If]]&lt;br /&gt;
{{reflist}}&lt;br /&gt;
}}&lt;br /&gt;
[[Category:Templates]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>wiki&gt;Pppery</name></author>
	</entry>
</feed>