Difference between revisions of "Template:Delay subst/doc"

From blackwiki
Jump to navigation Jump to search
imported>Wbm1058
(Created page with '{{Documentation subpage}} {{Distinguish|Template:Subst}} <!-- Categories go at the bottom of this page and interwikis go in Wikidata. --> == Usage == == See al...')
 
imported>Wbm1058
Line 4: Line 4:
  
 
== Usage ==
 
== Usage ==
 +
With certain coding, subst: does not automatically convert when it is saved. An editor can create wikitext that is only converted when saved again.
 +
 +
Normally wikitext like <code><nowiki>{{subst:a}}</nowiki></code> is not saved as <code><nowiki>{{subst:a}}</nowiki></code> if <code><nowiki>{{template:a}}</nowiki></code> exists, because [[help:substitution|subst:]] pastes the coding of template:a in the saved page.
 +
 +
==Delaying template substitution==
 +
"Subst" can be delayed with one save by creating and using {{tl|delay subst}}.
 +
 +
{|style="border-style: solid; border: 1px solid #000" cellpadding=10
 +
|-valign=top
 +
!template used
 +
!template coding
 +
!Paste or type
 +
!Save
 +
!Result
 +
|-
 +
|style="border-style: solid; border: 1px solid #000"|[[Template:Delay subst]]
 +
|style="border-style: solid; border: 1px solid #000"|<code><nowiki>{{subst:</nowiki></code>
 +
|style="border-style: solid; border: 1px solid #000"|<code><nowiki>{{subst:delay subst}}a|b}}</nowiki></code>
 +
|style="border-style: solid; border: 1px solid #000"|save page
 +
|style="border-style: solid; border: 1px solid #000"|<code><nowiki>{{subst:a|b}}</nowiki></code>
 +
|}
 +
 +
On the next save (with or without edits elsewhere on the page) results in substitution of template "a".
  
 
== See also ==
 
== See also ==

Revision as of 20:52, 17 May 2014

Usage

With certain coding, subst: does not automatically convert when it is saved. An editor can create wikitext that is only converted when saved again.

Normally wikitext like {{subst:a}} is not saved as {{subst:a}} if {{template:a}} exists, because subst: pastes the coding of template:a in the saved page.

Delaying template substitution

"Subst" can be delayed with one save by creating and using {{delay subst}}.

template used template coding Paste or type Save Result
Template:Delay subst {{subst: {{subst:delay subst}}a|b}} save page {{subst:a|b}}

On the next save (with or without edits elsewhere on the page) results in substitution of template "a".

See also