Bharatpedia:Template substitution: Difference between revisions

m
clean up, replaced: Wikipedia: → Bharatpedia: (2)
(Created page with "{{guideline|WP:SUBST}} The "'''subst:'''" keyword (short for "substitution") is used as a prefix inside template code. It changes the way the software e...")
 
m (clean up, replaced: Wikipedia: → Bharatpedia: (2))
Line 1: Line 1:
{{guideline|WP:SUBST}}
{{guideline|WP:SUBST}}
The "'''subst:'''" keyword (short for "substitution") is used as a prefix inside [[Wikipedia:Template|template code]]. It changes the way the software expands the template. Ordinarily, a template will be expanded "on the fly"; that is, every time you edit a page where the template is used, the template calls a separate page for the text, and the text it shows is updated. Placing "subst:" inside the template code when using it on a page, tells the software to substitute the template with text of the template (that is, the text that is on the template's article page ''when the template is added to the page''), so the output of the template is saved when you save the page, and it does not change even if the template is edited.
The "'''subst:'''" keyword (short for "substitution") is used as a prefix inside [[Bharatpedia:Template|template code]]. It changes the way the software expands the template. Ordinarily, a template will be expanded "on the fly"; that is, every time you edit a page where the template is used, the template calls a separate page for the text, and the text it shows is updated. Placing "subst:" inside the template code when using it on a page, tells the software to substitute the template with text of the template (that is, the text that is on the template's article page ''when the template is added to the page''), so the output of the template is saved when you save the page, and it does not change even if the template is edited.


== Usage ==
== Usage ==
You can subst a template by adding '''subst:''' to the beginning of the template tag. For example, you can use <nowiki>{{subst:test5}}</nowiki> instead of <nowiki>{{test5}}</nowiki>.
You can subst a template by adding '''subst:''' to the beginning of the template tag. For example, you can use <nowiki>{{subst:test5}}</nowiki> instead of <nowiki>{{test5}}</nowiki>.


When this is an important part of an edit, it is very good to mention the template in the [[Wikipedia:Edit summary|edit summary]] (for instance, put "<nowiki>{{subst:test}}</nowiki>" or "test1 applied" in your edit summary so other editors can easily see what you have done).
When this is an important part of an edit, it is very good to mention the template in the [[Bharatpedia:Edit summary|edit summary]] (for instance, put "<nowiki>{{subst:test}}</nowiki>" or "test1 applied" in your edit summary so other editors can easily see what you have done).


== Benefits of substitution ==
== Benefits of substitution ==
Bots, trusted
7,437

edits