<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://avidwiki.mywikis.net/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AUnsubst%2Fdoc</id>
	<title>Module:Unsubst/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://avidwiki.mywikis.net/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AUnsubst%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://avidwiki.mywikis.net/w/index.php?title=Module:Unsubst/doc&amp;action=history"/>
	<updated>2026-04-08T13:00:49Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.8</generator>
	<entry>
		<id>https://avidwiki.mywikis.net/w/index.php?title=Module:Unsubst/doc&amp;diff=115044&amp;oldid=prev</id>
		<title>imported&gt;Jeffersonkendric: Created page with &quot;&lt;!-- Categories where indicated at the bottom of this page, please. --&gt;  {{High-risk|2,200,000+}}  Helper module to facilitate a substituted template transform into a template...&quot;</title>
		<link rel="alternate" type="text/html" href="https://avidwiki.mywikis.net/w/index.php?title=Module:Unsubst/doc&amp;diff=115044&amp;oldid=prev"/>
		<updated>2021-08-29T10:16:35Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;!-- Categories where indicated at the bottom of this page, please. --&amp;gt;  {{High-risk|2,200,000+}}  Helper module to facilitate a substituted template transform into a template...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;!-- Categories where indicated at the bottom of this page, please. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{High-risk|2,200,000+}}&lt;br /&gt;
&lt;br /&gt;
Helper module to facilitate a substituted template transform into a template transclusion.&lt;br /&gt;
&lt;br /&gt;
Maintenance templates, such as {{tl|Citation needed}} or {{tl|Refimprove}}, should never be substituted. A trick to avoid that is to make a template substitute to its transcluded form.&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
&lt;br /&gt;
To turn a template into a self-substituting template, wrap the existing template code with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{ {{{|safesubst:}}}#invoke:Unsubst||$B=&lt;br /&gt;
&lt;br /&gt;
 [ ... existing template code ... ]&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The wikitext to display when not substed must be given as &amp;quot;$B&amp;quot;. A parameter &amp;quot;$N&amp;quot; may also be seen in some templates; this was required in an older version of the module, but is no longer necessary and may be removed. Such templates are automatically placed in {{clc|Calls to Module:Unsubst that use $N}}.&lt;br /&gt;
&lt;br /&gt;
All other parameters passed to the #invoke will be copied to the generated template invocation as default values. If the value of any of these default parameters is &amp;quot;__DATE__&amp;quot;, that value in the generated template invocation will be the current month and year.&lt;br /&gt;
&lt;br /&gt;
Some templates have a &amp;lt;nowiki&amp;gt;&amp;lt;noinclude&amp;gt;&amp;lt;/nowiki&amp;gt; but no matching &amp;lt;nowiki&amp;gt;&amp;lt;/noinclude&amp;gt;&amp;lt;/nowiki&amp;gt; at the end of the template. In such cases the missing &amp;lt;nowiki&amp;gt;&amp;lt;/noinclude&amp;gt;&amp;lt;/nowiki&amp;gt; must be added before the ending &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;
=== Example ===&lt;br /&gt;
Consider a template Template:Example containing the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{ {{{|safesubst:}}}#invoke:Unsubst||foo=bar |date=__DATE__ |$B=&lt;br /&gt;
&lt;br /&gt;
 [ ... Template code goes here ... ]&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Original !! Result&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{subst:example}}&amp;lt;/nowiki&amp;gt; || &amp;lt;nowiki&amp;gt;{{Example|foo=bar|date=&amp;lt;/nowiki&amp;gt;{{#time:F Y}}}}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{subst:example|foo=X}}&amp;lt;/nowiki&amp;gt; || &amp;lt;nowiki&amp;gt;{{Example|foo=X|date=&amp;lt;/nowiki&amp;gt;{{#time:F Y}}}}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{subst:example|baz=X}}&amp;lt;/nowiki&amp;gt; || &amp;lt;nowiki&amp;gt;{{Example|foo=bar|baz=X|date=&amp;lt;/nowiki&amp;gt;{{#time:F Y}}}}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{subst:example|date=January 2001}}&amp;lt;/nowiki&amp;gt; || &amp;lt;nowiki&amp;gt;{{Example|foo=bar|date=January 2001}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{#ifeq:{{SUBPAGENAME}}|sandbox |&lt;br /&gt;
| &amp;lt;!-- Categories below this line, please; interwikis at Wikidata --&amp;gt;&lt;br /&gt;
[[Category:Wikipedia metatemplates]]&lt;br /&gt;
[[Category:Modules that add a tracking category]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>imported&gt;Jeffersonkendric</name></author>
	</entry>
</feed>