<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.bharatpedia.org/w/index.php?action=history&amp;feed=atom&amp;title=Bharatpedia%3ATemplate_namespace</id>
	<title>Bharatpedia:Template namespace - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://en.bharatpedia.org/w/index.php?action=history&amp;feed=atom&amp;title=Bharatpedia%3ATemplate_namespace"/>
	<link rel="alternate" type="text/html" href="https://en.bharatpedia.org/w/index.php?title=Bharatpedia:Template_namespace&amp;action=history"/>
	<updated>2026-09-23T14:43:10Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://en.bharatpedia.org/w/index.php?title=Bharatpedia:Template_namespace&amp;diff=563495&amp;oldid=prev</id>
		<title>WikiDwarf: Add</title>
		<link rel="alternate" type="text/html" href="https://en.bharatpedia.org/w/index.php?title=Bharatpedia:Template_namespace&amp;diff=563495&amp;oldid=prev"/>
		<updated>2026-07-12T15:30:36Z</updated>

		<summary type="html">&lt;p&gt;Add&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{short description|Type of page within Bharatpedia}}&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{Protected due to vandalism|small=yes}}{{Move-protected}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{Redirect-distinguish|BP:TMP|Bharatpedia:Temporary account}}&lt;br /&gt;
{{For|learning how templates work|Help:A quick guide to templates|Help:Template}}&lt;br /&gt;
{{Distinguish|Template:Namespaces}}&lt;br /&gt;
{{Subcat guideline|project content guideline||BP:TMP|BP:NS10}}&lt;br /&gt;
{{Nutshell|The Template: namespace on Bharatpedia contains templates created for consistent formatting, maintenance, and navigation. Templates should not normally be used to store [[Bharatpedia:What is an article?|article text]]. Such content belongs in the article pages themselves.}}&lt;br /&gt;
{{Guideline list}}&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Template namespace&amp;#039;&amp;#039;&amp;#039; on Bharatpedia is used to store [[Help:Template|templates]], which contain [[Help:Wiki markup|Wiki markup]] intended for inclusion on multiple pages, usually via [[Bharatpedia:Transclusion|transclusion]]. Although the Template namespace is used for storing most templates, it is possible to transclude and substitute from other namespaces, and so some template pages are placed in other namespaces, such as the [[BP:User namespace|User namespace]].&lt;br /&gt;
&lt;br /&gt;
Templates help maintain consistent formatting and aid navigation between articles. They often include optional and/or variable elements controlled by [[Help:Template#Parameters|parameters]] to allow for specialized use. Templates are also used to assist in a large variety of [[Bharatpedia:Maintenance|Bharatpedia maintenance]] tasks. Each template has a matching &amp;lt;code&amp;gt;Template talk:&amp;lt;/code&amp;gt; page where editors can discuss the design and implementation of the associated template (see [[Help:Using talk pages]] for how to participate in talk page discussions).&lt;br /&gt;
&lt;br /&gt;
A template is transcluded into another page by including a template tag in that page&amp;#039;s content. A template tag contains the template [[BP:page name|page name]] surrounded by double curly braces, e.g. {{tlc|Disambiguation}}. If the template&amp;#039;s page name does not begin with a namespace and colon, it is assumed to be in the Template namespace.&lt;br /&gt;
&lt;br /&gt;
Internal links to template pages may be made by using the &amp;lt;code&amp;gt;Template:&amp;lt;/code&amp;gt; prefix, e.g. &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[[Template:Disambiguation]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. See {{slink||Linking to templates}} for other ways to link to a template.&lt;br /&gt;
&lt;br /&gt;
==&amp;lt;span class=&amp;quot;anchor&amp;quot; id=&amp;quot;Guidelines&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;General==&lt;br /&gt;
{{shortcut|BP:TG|BP:TMPG}}{{namespaces}}&lt;br /&gt;
{{further|Bharatpedia:Be bold#Template namespace}}&lt;br /&gt;
* Templates should not normally be used to store [[Bharatpedia:What is an article?|article text]] that may need to edited, as this makes it more difficult to do so. They should also [[Bharatpedia:Manual of Style#Scrolling lists and collapsible content|not be used to &amp;quot;collapse&amp;quot; or &amp;quot;hide&amp;quot; content]] from the reader.&lt;br /&gt;
* Templates used in articles are designed to provide information to assist readers, such as navigation aids, formatting, or warnings that content is sub-standard. Templates that provide information only of service to editors should not appear on article pages{{snd}}use the article&amp;#039;s talk page or other non-article namespaces.&lt;br /&gt;
* Template function should be clear from the [[#Template names|template name]], but [[Bharatpedia:Redirects#Template redirects|redirects]] can be created to assist everyday use of very popular templates.&lt;br /&gt;
* [[Bharatpedia:High-risk templates|High-risk templates]] should be semi-protected, [[Bharatpedia:Template editor|template protected]], or fully protected as appropriate (see [[Bharatpedia:Protection policy]]). This applies also to any high-use template redirects.&lt;br /&gt;
* Templates should be clearly [[#Documentation|documented]] as to their usage and scope.&lt;br /&gt;
* Templates should not be used to create lists of links to other articles when a [[Bharatpedia:Categories, lists, and navigation templates#Categories|category]], [[Bharatpedia:Categories, lists, and navigation templates#Lists|list page]], or [[Bharatpedia:See also|&amp;quot;See also&amp;quot; section list]] can perform the same function.&lt;br /&gt;
* Templates for short, temporary messages that will be removed quickly (such as on User_talk: pages) or that contain text which is not likely to ever be changed should be invoked with [[#Substitution|substitution]] (subst:). Typical templates that are intended for long-term use and are likely to require changes should be transcluded for easy future updates.&lt;br /&gt;
* Templates that violate the guidelines on this page, have poorly defined functionality, are redundant, become orphaned or are used on only one page, or violate any Bharatpedia policies may be nominated for deletion at [[Bharatpedia:Templates for discussion]].&lt;br /&gt;
&lt;br /&gt;
==Linking to templates==&lt;br /&gt;
Internal links to template pages may be made by using the &amp;lt;code&amp;gt;Template:&amp;lt;/code&amp;gt; prefix or its [[BP:ALIAS|alias]] &amp;lt;code&amp;gt;TM:&amp;lt;/code&amp;gt;, e.g. &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[[Template:Disambiguation]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[[TM:Disambiguation]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. These links go to a page that directly contains a base template, but subpages such as the template&amp;#039;s [[#Documentation|documentation]] can be linked directly as well, e.g. &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[[Template:Disambiguation/doc]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To link to a template using a display format appropriate for templates, use [[Template:Tl]] (short for &amp;quot;template link&amp;quot;). For example, to reference the Cleanup template, typing &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{tl|Cleanup}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; results in {{tl|Cleanup}}. This does not call the template, but the display clearly indicates that the linked object is a template. You can also add parameters using [[Template:Tlp]]; for example, &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{tlp|Convert|1|m}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; displays as {{tlp|Convert|1|m}}. Check the template documentation on [[Template:Tl]] for other options, such as {{tlb|tlb}} (bold), {{tlx|tlx}} (code), {{tlxi|tlxi|param1|param2}} (italic parameters), {{tnl|tnl}} (no link), and many more.&lt;br /&gt;
&lt;br /&gt;
==&amp;lt;span class=&amp;quot;anchor&amp;quot; id=&amp;quot;Suggested practices&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;Common practices==&lt;br /&gt;
&lt;br /&gt;
===Template names===&lt;br /&gt;
{{shortcut|BP:TPN}}&lt;br /&gt;
Template names should be made of one or more words, and describe the template clearly, as in {{tlc|Math topics sidebar}}. Template names are easiest to remember if they follow standard English spelling, spacing, and capitalization. Avoid having templates whose names differ only in case, spacing, or punctuation.&lt;br /&gt;
&lt;br /&gt;
For templates with long names, [[Bharatpedia:Redirect#Template_redirects|template redirects]] (often called shortcuts) can be created for ease of typing. For example, instead of typing {{tlc|Template link with subst}} the shortcut {{tlc|tls}} is available. Shortcuts are very useful when a template is used frequently, but are not necessary for templates that are added to articles once and then left alone, as [[Help:Wikitext|wikitext]] should not prioritize brevity over readability. &lt;br /&gt;
&lt;br /&gt;
Like other pages, the first character of a template is not case-sensitive, so {{tlc|cleanup}} and {{tlc|Cleanup}} are the same template. All other characters are case sensitive, so {{tlc|CFD}} and {{tlc|Cfd}} are not the same. For high-use templates like {{tl|Category for deletion}}, redirects from capitalizations that an editor might expect are a good idea.&lt;br /&gt;
&lt;br /&gt;
===Sandbox for experiments===&lt;br /&gt;
{{Main|Bharatpedia:Template sandbox and test cases}}&lt;br /&gt;
If you wish to experiment with templates (and not have your experiments deleted before you are done with them), you may do so in the [[Template:Template sandbox|Template sandbox]]. You may also use the templates [[Template:X1|X1]], [[Template:X2|X2]], [[Template:X3|X3]], [[Template:X4|X4]], [[Template:X5|X5]], [[Template:X6|X6]], [[Template:X7|X7]], [[Template:X8|X8]], [[Template:X9|X9]], [[Template:X10|X10]], [[Template:X11|X11]], and [[Template:X12|X12]] for experimental purposes. To include a test template, use the form {{tlc|X1}} for template X1, {{tlc|X2}} for template X2, etc.&lt;br /&gt;
&lt;br /&gt;
Existing templates often each have their own [[Bharatpedia:Template sandbox and test cases|sandbox and test case]] pages (especially those that use {{tl|Documentation}}). Changes should be thoroughly tested there before being applied to the main template, in order to prevent unintentional damage to many pages.&lt;br /&gt;
&lt;br /&gt;
===Readability of the code===&lt;br /&gt;
For templates that have a large number of parameters, it can be helpful to place each parameter on a separate line and align the equals signs. This helps future editors to more easily read the wikicode. For example, if you wish to create a new [[Help:Infobox|infobox]] – which may contain dozens of parameters – your code might look like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;&lt;br /&gt;
{{Infobox&lt;br /&gt;
| header1  = Text of header1&lt;br /&gt;
| label2   = Text of label2&lt;br /&gt;
| data2    = Text of data2&lt;br /&gt;
| etc      = etc&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Templates using many [[Help:Conditional expressions|conditional expressions]] often benefit from line spacing, such as the following code used in {{tl|If either}}&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;&lt;br /&gt;
{{#if:{{{1|}}}&lt;br /&gt;
 |{{{then|{{{3|}}}}}}&lt;br /&gt;
 |{{#if:{{{2|}}}&lt;br /&gt;
  |{{{then|{{{3|}}}}}}&lt;br /&gt;
  |{{{else|{{{4|}}}}}}&lt;br /&gt;
 }}&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While not necessary, the demonstrated line breaks allow for easier parsing of which conditionals relate to which #if statement.&lt;br /&gt;
&lt;br /&gt;
===Line breaks===&lt;br /&gt;
While line breaks in the body of a template code are useful for readability, line breaks at the beginning or end of template code could cause display issues on articles. Care should be taken when coding templates to ensure that there is no unnecessary whitespace. A single line break in an infobox may combine with a line break in an article to cause a paragraph break, or could cause an unwanted template in an inline template. As a general guideline, avoid two line breaks together in your template. These may &amp;quot;add up&amp;quot; with other line breaks in the article and be displayed as unwanted white space. For more information about line breaks as they affect wikitext, see [[Bharatpedia:Line-break handling]].&lt;br /&gt;
&lt;br /&gt;
To avoid unnecessary whitespace, ensure that any {{tag|noinclude|o}} tags are placed immediately after the template code. The following code is from {{t|questions}} and has good line break management.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=wikitext&amp;gt;&lt;br /&gt;
{{notice|small=yes|If you want to ask a question, please see the [[Bharatpedia:Questions]] page for guidance.}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Bharatpedia help templates]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Substitution===&lt;br /&gt;
{{Main|Bharatpedia:Substitution}}&lt;br /&gt;
Invoking a template using the form&lt;br /&gt;
: &amp;lt;code&amp;gt;{{{{highlight|1=&amp;lt;span style=&amp;quot;color:var(--color-base,#202122);&amp;quot;&amp;gt;subst:&amp;lt;/span&amp;gt;|2=var(--background-color-warning-subtle, #fdf2d5)}}{{var|Template name}} |{{var|Parameter1 name}}}}&amp;lt;/code&amp;gt;&lt;br /&gt;
(that is, inserting &amp;lt;code&amp;gt;subst:&amp;lt;/code&amp;gt; immediately after the opening pair of curly brackets)&lt;br /&gt;
will make a copy of the template text and place it on the page, where it will be viewable in the source. The template is no longer [[transclusion|transcluded]] and future changes to the template will not change the text. As a [[#Guideline|guideline]], this method should be used for any short, temporary messages which are removed quickly, such as on User_talk: pages. The standard new user {{stlx|Welcome}} message is a good example.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;subst:&amp;lt;/code&amp;gt; also if you need to edit the message after including it on the page. If you don&amp;#039;t need to edit it, and would rather the message is automatically updated along with changes made to the template, don&amp;#039;t use &amp;lt;code&amp;gt;subst:&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Documentation===&lt;br /&gt;
{{Main|Bharatpedia:Template documentation}}&lt;br /&gt;
Because templates represent a step up in difficulty for the novice editor, documentation should be provided which describes its usage (optional parameters) and scope (where it should be used). There are two different ways to do this:&lt;br /&gt;
&lt;br /&gt;
One option is to use the {{t|documentation}} template to add a minor description directly onto the template page. As mentioned in {{slink||Line breaks}}, the first {{tag|noinclude|o}} tag should be placed on the same line as the last character of the actual template. For example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=wikitext&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This is a {{{1}}} article.&amp;#039;&amp;#039;&amp;#039;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation|content=&lt;br /&gt;
Place this template on any article that requires description. It&lt;br /&gt;
takes one parameter, an adjective used to describe the article.&lt;br /&gt;
For example, {{article-describe|bad}} produces the text,&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This is a bad article.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another alternative is to create a formal [[Bharatpedia:DOC|/doc subpage]] for the documentation (preferred for templates with multiple parameters, etc.). The {{t|documentation}} template is still called, but all of the displayed text will be transcluded from the template&amp;#039;s /doc subpage.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=wikitext&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This is a {{{1}}} article.&amp;#039;&amp;#039;&amp;#039;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Modules===&lt;br /&gt;
{{Main|Bharatpedia:Lua}}&lt;br /&gt;
Lua modules are sometimes used instead of templates to store reusable material. Reasons for this include usage of module-specific features such as [[loop (programming)|loops]] or stored values, and complex code is often easier to read and maintain in a module. If a module is easily implementable in a template it generally should be, since there are more users with experience editing templates.&lt;br /&gt;
&lt;br /&gt;
If a module is intended to be used in articles or talk pages, a template wrapper should generally be created to simplify usage without directly requiring the &amp;lt;code&amp;gt;{{#invoke}}:&amp;lt;/code&amp;gt; parser function. Documentation is then mostly located on the template&amp;#039;s /doc page, with the module&amp;#039;s documentation pointing to the template and/or explaining further technical details that are unnecessary at the primary template documentation.&lt;br /&gt;
&lt;br /&gt;
A template wrapper uses more of the [[BP:PEIS|post-expand include size limit]] than calling the module directly, therefore it may be necessary to avoid using one in articles that are near the limit.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
Historically, an &amp;quot;msg:&amp;quot; prefix had to be added in front of the template name when it was used on a page. For example, &amp;lt;nowiki&amp;gt;{{msg:stub}} was typed instead of {{stub}}&amp;lt;/nowiki&amp;gt;. This is no longer necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Searching for templates==&lt;br /&gt;
Use this form to search in the Template: or Template_talk: namespaces. See [[Help:Searching]] for more information.&lt;br /&gt;
&amp;lt;inputbox&amp;gt;&lt;br /&gt;
type=search&lt;br /&gt;
break=no&lt;br /&gt;
namespaces=Template**,Template_talk&lt;br /&gt;
searchbuttonlabel=Search within the Template: namespace&lt;br /&gt;
&amp;lt;/inputbox&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pages which contain information on commonly used templates:&lt;br /&gt;
* [[Bharatpedia:Template index]] for an index of text-based templates.&lt;br /&gt;
* [[Bharatpedia:Navigation template]]s for a partial list of various subject-class navigational elements.&lt;br /&gt;
* [[Bharatpedia:List of infoboxes]] for infoboxes, which are small panels that summarize key features of the page&amp;#039;s subject.&lt;br /&gt;
* [[Bharatpedia:Categorization]] for templates used for [[Help:Category|categories]]&lt;br /&gt;
* [[Bharatpedia:Citation templates]] for templates used to format article [[Bharatpedia:Citing sources|references and citations]]&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re unable to find an existing template for your situation, but don&amp;#039;t feel comfortable creating one yourself, you can ask for help at [[Bharatpedia:Requested templates]].&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Help:Template]] for information on developing templates and syntax details&lt;br /&gt;
* [[Help:Magic words]] for all template modifiers&lt;br /&gt;
* [[Help:Conditional tables]]&lt;br /&gt;
* [[Bharatpedia:Template standardisation]]&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
{{Bharatpedia policies and guidelines}}&lt;br /&gt;
{{Bharatpedia templates|state=collapsed}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Bharatpedia template administration|Namespace]]&lt;br /&gt;
[[Category:Bharatpedia how-to|{{PAGENAME}}]]&lt;br /&gt;
[[Category:Bharatpedia features|{{PAGENAME}}]]&lt;br /&gt;
[[Category:Bharatpedia template guidelines|namespace]]&lt;br /&gt;
[[Category:Bharatpedia template help]]&lt;/div&gt;</summary>
		<author><name>WikiDwarf</name></author>
	</entry>
</feed>