Help: Template Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.Anti-spam check. Do not fill this in! ===General=== Using a template is much like calling a [[Subroutine|function]] in a programming language – call it, and it returns a value. For a template, the return value is called the ''expansion'' of the template and is treated as part of the calling page source. Like functions, some templates accept parameters that affect the output. Calling a template causes it to be either transcluded or substituted in the page that calls it (which is known as the ''target page''). Transcluding a template means that when MediaWiki displays the page, it treats the template as if it were in the wiki source of the page, whereas substituting means MediaWiki does that when it <em>saves</em> the page (i.e. the content of the template gets stored as part of the target page and subsequent editors cannot tell that it got there via a template). To transclude a template into a page, put {{tnull|{{var|Template name}}}} in the page source at the place where the template is to appear. The first letter of each word of the title may equivalently be lower- or upper-case. To substitute a template into a page, use {{tnull|subst:{{var|Template name}}}} instead. This wikitext is called a ''template call''. In [[MediaWiki]], the [[wiki software]] that Wikipedia uses, [[Help:Magic words#Variables|variables]] are distinct from templates, but they are both identified by double [[Curly brackets|braces]] <code><nowiki>{{ }}</nowiki></code> and they both return a value. Whereas MediaWiki variable names are all uppercase, template names have the same basic features and [[WP:NCHASHTAG|limitations]] as all [[Help:Page name|page names]]: they are [[Case sensitivity|case-sensitive]] (except for the first character); [[underscore]]s are parsed as spaces; and they cannot contain any of these characters: <code><nowiki># < > [ ] | { }</nowiki></code>. This is because those are reserved for [[wiki markup]]. The [[number sign]] <code>#</code> is called a [[URI fragment|fragment identifier]] because it denotes a {{em|fragment}} or section of a document (such as a [[Help:Section|section]] in a Wikipedia article). Although it [[WP:ANCHOR|can be used]] to link to a section of a template page (like [[Template:Portal#Example]]), there is no reason to put a fragment identifier or fragment name in a template reference. In {{tnull|Portal{{var|#Location}}|Books}}, for example, the string <code>{{var|#Location}}</code> has no purpose and is thus ignored. The template namespace is the default, so you can leave out the namespace <code>Template:</code> in the template name, and it is conventional to do so. However, you must specify the namspace prefix for templates in other namespaces, such as <code>User:</code>. To transclude a page in [[WP:MAINSPACE|mainspace]], precede its title with a colon, as <code>{<nowiki />{:{{var|Page name}}}}</code>. {{A note}} Attempting to transclude a template that does not exist produces a [[WP:Red link|red link]], just like linking to any other nonexistent page. Following the link allows one to create that particular template. It is not possible to transclude pages between projects (such as different-language Wikipedias or MediaWiki)—to use a template on another language project, a copy of the template must be created in that project. Summary: Please note that all contributions to Christianpedia may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here. You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Christianpedia:Copyrights for details). Do not submit copyrighted work without permission! Cancel Editing help (opens in new window) Discuss this page