<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh">
	<id>https://arolstar52-zhtest.hf.space/index.php?action=history&amp;feed=atom&amp;title=Template%3AConditional_template_call_with_newline%2Fdoc</id>
	<title>Template:Conditional template call with newline/doc - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://arolstar52-zhtest.hf.space/index.php?action=history&amp;feed=atom&amp;title=Template%3AConditional_template_call_with_newline%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://arolstar52-zhtest.hf.space/index.php?title=Template:Conditional_template_call_with_newline/doc&amp;action=history"/>
	<updated>2026-07-15T19:56:56Z</updated>
	<subtitle>在这个wiki上该页的修订历史</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://arolstar52-zhtest.hf.space/index.php?title=Template:Conditional_template_call_with_newline/doc&amp;diff=739909&amp;oldid=prev</id>
		<title>imported&gt;TimWu007 来自 2019年4月6日 (六) 17:41</title>
		<link rel="alternate" type="text/html" href="https://arolstar52-zhtest.hf.space/index.php?title=Template:Conditional_template_call_with_newline/doc&amp;diff=739909&amp;oldid=prev"/>
		<updated>2019-04-06T17:41:51Z</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;{{Documentation subpage}}&lt;br /&gt;
该模版在条件{{{1}}}下调用模版{{{2}}}并使用参数{{{3}}}，且在结尾添加一个换行符。&lt;br /&gt;
&lt;br /&gt;
该模板用于避免两次写出条件：一次用于模板调用，一次用于换行。[[Template:If]]可用于保留换行符。&lt;br /&gt;
&lt;br /&gt;
==用法==&lt;br /&gt;
===Sample 1===&lt;br /&gt;
Example using [[Template:2x]], which simply repeats its argument twice, so &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{2x|Pizza}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; produces {{2x|Pizza}}.  One can combine this with {{tld|Conditional template call with newline}} in the following code&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#tag:pre|{{Conditional template call with newline|1|2x|Pizza}}{{Conditional template call with newline|0|2x|Bora}}{{Conditional template call with newline|1|2x|Bang}}}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:which produces&lt;br /&gt;
&lt;br /&gt;
{{#tag:pre|{{Conditional template call with newline|1|2x|Pizza}}{{Conditional template call with newline|0|2x|Bora}}{{Conditional template call with newline|1|2x|Bang}}}}&lt;br /&gt;
&lt;br /&gt;
Notice how {{2x|Bora}} is suppressed, and there is a newline between {{2x|Pizza}} and {{2x|Bang}}.&lt;br /&gt;
&lt;br /&gt;
===Sample 2===&lt;br /&gt;
Example using {{tl|Table row Dutch municipality}}&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre style=&amp;quot;overflow:auto&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
!Municipality!!Population&lt;br /&gt;
{{Conditional template call with newline|1|Table row Dutch municipality|Delft}}{{Conditional template call with newline|0|Table row Dutch municipality|Hoorn}}{{Conditional template call with newline|1|Table row Dutch municipality|Rotterdam}}|}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
gives&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
!Municipality!!Population&lt;br /&gt;
{{Conditional template call with newline|1|Table row Dutch municipality|Delft}}{{Conditional template call with newline|0|Table row Dutch municipality|Hoorn}}{{Conditional template call with newline|1|Table row Dutch municipality|Rotterdam}}|}&lt;br /&gt;
&lt;br /&gt;
The template is typically called by another table row template, which has as parameter {{{1}}} the identification of the potential item (in this template: {{{3}}}), and some parameter {{{2}}} related to the condition. That template provides the condition in terms of {{{1}}} and {{{2}}}.&lt;br /&gt;
&lt;br /&gt;
===Sample 3===&lt;br /&gt;
Sample usage with full substitution of the template to create a newline in wikitext.&lt;br /&gt;
&lt;br /&gt;
1. Create a sample template : &amp;quot;[[Template:testnewline]]&amp;quot;&lt;br /&gt;
&amp;lt;pre style=&amp;quot;overflow:auto&amp;quot;&amp;gt;&lt;br /&gt;
ABC{{&amp;lt;includeonly&amp;gt;subst:&amp;lt;/includeonly&amp;gt;Conditional template call with newline|{{&amp;lt;includeonly&amp;gt;subst:&amp;lt;/includeonly&amp;gt;#ifeq:{{{align|}}}|{{{align}}}|1|0}}|void|1|substctc=subst:|subst=subst:}}&lt;br /&gt;
DEF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. When called empty (&amp;lt;nowiki&amp;gt;{{subst:testnewline}}&amp;lt;/nowiki&amp;gt;), it generates the following wikitext:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ABC&lt;br /&gt;
DEF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. When called as &amp;lt;nowiki&amp;gt;{{subst:testnewline|align=somevalue}}&amp;lt;/nowiki&amp;gt;, it generates the following wikitext (note the newline):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ABC&lt;br /&gt;
&lt;br /&gt;
DEF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==参数==&lt;br /&gt;
===必选参数===&lt;br /&gt;
;&amp;lt;tt&amp;gt;1&amp;lt;/tt&amp;gt;: 第一个未命名参数，用于判断条件。其中1代表真（True），而0代表假（False）。如果条件为真，那么第二个模板将被调用，并在结尾添加一个换行符。可直接输入0或1。&amp;lt;br /&amp;gt;示例：&amp;lt;nowiki&amp;gt;{{#ifeq:{{{align|}}}|{{{align}}}|1|0}}&amp;lt;/nowiki&amp;gt;。当一个模板被调用，且使用align为任意值的参数时条件为真：而align未包含时条件为假。&lt;br /&gt;
;&amp;lt;tt&amp;gt;2&amp;lt;/tt&amp;gt;: 第二个未命名参数，为需要调用模板的名称。&amp;lt;br /&amp;gt;可使用[[Template:!]]代替“!”，[[Template:Void]]代替“void”。&lt;br /&gt;
&lt;br /&gt;
===可选参数===&lt;br /&gt;
;&amp;lt;tt&amp;gt;3&amp;lt;/tt&amp;gt;: 3rd unnamed parameter, value to be assigned to {{{1}}} when calling template {{{2}}}&lt;br /&gt;
;&amp;lt;tt&amp;gt;substctc&amp;lt;/tt&amp;gt;: for substitution of some parser functions and auxiliary templates called inside the template, use the value &amp;quot;subst:&amp;quot;; recommended when the template is substituted; note that in that case any parser functions or templates in the condition have to be substituted too.&lt;br /&gt;
;&amp;lt;tt&amp;gt;subst&amp;lt;/tt&amp;gt;: for substitution of template {{{2}}}, use the value &amp;quot;subst:&amp;quot;&lt;br /&gt;
;&amp;lt;tt&amp;gt;p1n&amp;lt;/tt&amp;gt;: name of an additional parameter used by template {{{2}}}&lt;br /&gt;
;&amp;lt;tt&amp;gt;p1v&amp;lt;/tt&amp;gt;: value to be assigned to {{{p1n}}} when calling template {{{2}}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;&amp;lt;!--&lt;br /&gt;
++++ PLEASE ADD CATEGORIES AND INTERWIKIS BELOW THIS LINE, THANK YOU. --&amp;gt;&lt;br /&gt;
[[en:Template:Conditional template call with newline]]&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>imported&gt;TimWu007</name></author>
	</entry>
</feed>