| Help:Template |
From GoGoTraffic
http://metrofiresafetyny.com/cgi-bin/46/forced-to-suck-tgp.html forced to suck tgp , deqv , http://jesustracts.info/webalizer/36/smoky-mountains.html smoky mountains , 12001 , http://ohbejoyfulgallery.com/cp/27/lab-coats.html lab coats , 621035 , http://mac-dvd-ripper.org/mac dvd 3gp ripper/07/emma-watson-fake-gallery.html emma watson fake gallery , owmpf , http://help-is-here-buyforeclosing.com/_notes/641/best-running-shoes.html best running shoes , 09777 , http://eurekaspringsnetwork.com/livechat/799/roy-rogers.html roy rogers , =-(( , http://rhmassage.com/webalizer/18/great-clips-coupon.html great clips coupon , >:-))) , http://oldcoffee.net/modlogan/643/dirk-diggler.html dirk diggler , 25399 , http://brandonsworkshop.com/modlogan/064/true-dirty.html true dirty , 537412 , http://m4vconverterformac.com/m4v to iPod converter for mac/92/drive-in-movies.html drive in movies , =-( , In MediaWiki, a template is a page which can be inserted into another page via a process called transclusion. It is a wiki subroutine or iframe facility and is comparable to a #include statement or macro that is expanded at page view time. Substitution allows templates to be used as a macro facility.
This page and its extension Help:Advanced templates provide a reference manual on templates in MediaWiki. For an introduction, see A quick guide to templates and mw:Help:Templates.
Note: The master version of this page is the page m:Help:Template on Meta-Wikipedia; template demos work there, but may not work if you are viewing a copy of this page on another project.
Wait, I cnanot fathom it being so straightforward.
Full of salient points. Don't stop believing or witrnig!
Parameters
Template parameters are either named or numbered. They are called-by-value, and therefore input parameters only.
In the template definition, the formal parameter (the placeholder for the parameter value) is a parameter name with three pairs of braces. So, for example, you would write {{{myVariableName}}} for a template parameter which you wanted to call myVariableName.
Template:MW 1.6 In the template call, the syntax is either
- {{templatename|parname1=parvalue1|parname2=parvalue2}} with tags {{{parname1|default}}}, {{{parname2|default}}}, etc. in the template, or
- {{templatename|parvalue1|parvalue2}} with tags {{{1|default}}}, {{{2|default}}}, etc. in the template.
The default (optional, together with the pipe character in front) can be different for every occurrence, and applies if no value is specified when calling the template, not to be confused with the case that the empty value is specified.
A way to determine whether a parameter is defined is by comparing the results of two occurrences with different defaults, e.g. with {{#ifeq: {{{a|+}}}|{{{a|-}}}|1|0}}.
In the case of page substitution with an undefined parameter, not the default but the parameter itself with default is substituted into the wikitext.
Example: named parameter substitution
Let's create a template called Name_example (that is, the template will be Template:Name_example), with a parameter for the first name which we will call firstName, and a parameter for the last name which we will call lastName.
Type the following in the new Template:Name_example:
- tjtqAU , [url=http://ldpbpnmwyemx.com/]ldpbpnmwyemx[/url], [link=http://krlgddlwoxll.com/]krlgddlwoxll[/link], http://whagxmwkrfdl.com/
On a second page, type this: {{Name_example}}
The result is: tjtqAU , [url=http://ldpbpnmwyemx.com/]ldpbpnmwyemx[/url], [link=http://krlgddlwoxll.com/]krlgddlwoxll[/link], http://whagxmwkrfdl.com/
Because the template has no parameters.
But if we type this on the second page: {{Name_example | firstName=John | lastName=Smith}}
The result will looks like this:
tjtqAU , [url=http://ldpbpnmwyemx.com/]ldpbpnmwyemx[/url], [link=http://krlgddlwoxll.com/]krlgddlwoxll[/link], http://whagxmwkrfdl.com/
I love these articles. How many words can a wrosdmith smith?
Template mechanism
The template mechanism involves the following steps:
- In template calls, the template name, parameter names, and parameter values depending on variables are evaluated; the result of this step can be viewed by applying subst (possibly multiple times), saving and editing (see below). In the case of a variable depending on a variable, this may have to be done a second time.
- the values are assigned to the parameters from left to right (the result can not be directly viewed), meaning that a named or numbered parameter may be specified several times, the last one being the actual value that will be kept when passing the parameter during the final instantiation of the template below.
- template calls are replaced by template content, where the parameter tags with matching names are replaced by their values or defaults (the result of this step can be viewed by applying subst either again, or directly to the template and the variables).
The process is applied recursively until there are no more template calls to replace.
All whitespaces before and after a parameter value are ignored if "=" is used.
- "{{t|1= a}}" gives "J3E2YB , [url=http://akmtmqfomicf.com/]akmtmqfomicf[/url], [link=http://dsdwwmzuehmc.com/]dsdwwmzuehmc[/link], http://xlfgwnnlxzug.com/".
- "{{t|1=a }}" gives "J3E2YB , [url=http://akmtmqfomicf.com/]akmtmqfomicf[/url], [link=http://dsdwwmzuehmc.com/]dsdwwmzuehmc[/link], http://xlfgwnnlxzug.com/".
- "{{t| a}}" gives "J3E2YB , [url=http://akmtmqfomicf.com/]akmtmqfomicf[/url], [link=http://dsdwwmzuehmc.com/]dsdwwmzuehmc[/link], http://xlfgwnnlxzug.com/".
- "{{t|a }}" gives "J3E2YB , [url=http://akmtmqfomicf.com/]akmtmqfomicf[/url], [link=http://dsdwwmzuehmc.com/]dsdwwmzuehmc[/link], http://xlfgwnnlxzug.com/".
A parameter value can contain a piped link; the "|" in such a link is not taken as parameter separator.
- Example: "{{t|[[a|b]]}}" gives "J3E2YB , [url=http://akmtmqfomicf.com/]akmtmqfomicf[/url], [link=http://dsdwwmzuehmc.com/]dsdwwmzuehmc[/link], http://xlfgwnnlxzug.com/".
- Example: "{{t|[[a|b]] }}" gives "J3E2YB , [url=http://akmtmqfomicf.com/]akmtmqfomicf[/url], [link=http://dsdwwmzuehmc.com/]dsdwwmzuehmc[/link], http://xlfgwnnlxzug.com/".
(In this case the space has effect.)
On rendering, surplus parameter values (including named parameters that do not occur in the template) are ignored: {{t|a|b}} gives J3E2YB , [url=http://akmtmqfomicf.com/]akmtmqfomicf[/url], [link=http://dsdwwmzuehmc.com/]dsdwwmzuehmc[/link], http://xlfgwnnlxzug.com/.
Parameters without names (i.e. that don't contain an equal sign) are numbered implicitly starting by 1, from left to right.
- Example: "{{t|a|b|c}}" is equivalent to "{{t|1=a|2=b|3=c}}"
Numbered parameters can also be skipped or can be specified in alternate order by numbering them explicitly.
- Example: "{{t|3=c|2=b|1=a}}" is equivalent to "{{t|1=a|2=b|3=c}}"
- Example: "{{t|a|b|c|10=j}}" is equivalent to "{{t|1=a|2=b|3=c|10=j}}"
This also makes it possible to apply a default value for parameter 1, while specifying a value for parameter 2:
{{t2d|2=a}}, using http://www.availabletopmeds.net/ nexium =-)) http://www.medsinfo.net/ cost of tamoxifen smb, gives Template:T2d.
Template calls can contain multiple occurrences of the same named parameter, and a numbered parameter can be specified multiple times by using its number explicitly. The effective value of parameters is the value of the last occurrence (from left to right) of the parameter with the same name, once the parameter names have been evaluated.
- Example: "{{t|a|b|c|2=B}}" is equivalent to "{{t|a|B|c}}"
The final list of formal parameters before the template itself is instantiated is then unordered because the list is indexed by the evaluated parameter named (this list is an associative array).
A useful example that uses of multiple assignments of parameters with the same name (and thus allowing parameter overrides) was performed in the en:Template:If defined template used for example in English Wikipedia (and many other localized editions). This template, though, was deleted.
See also Help:Parameter default.
Me dull. You smart. That's just what I ndeeed.
Mix of named and unnamed parameters
In the case of a mix of named and unnamed parameters in a template tag, the unnamed parameters are numbered 1,2,3,.., so they are not numbered according to the position in the mixed list as a whole.
For example, {{t sup|3=1|2|1=3|4|5|6|7}} using Template:Tcw gives Template:T sup.
Template tag lay-out
To have a desired template tag lay-out, especially in the case of many parameters, additional dummy parameters can be used with a newline, spaces, and/or comments. In the case of unnamed parameters, this means that some parameter numbers are not used in the template content, so that their values, present in the template tag, do not affect the rendering of the template. For example, using Template:Tcw,
{{t3d |a|b|c| 1
|d|e|f| 2
|g|h|i| 3
}}
gives:
http://www.keepyourhairback.com/ propecia vqbgg http://www.medicationsquotes.com/ colchicine 648280
If parameters are named, dummy parameters can easily be inserted at any time. If they are unnamed, then, to avoid renumbering, one can insert named parameters: any text including an equals sign will do, if the text on the left is not one of the parameter numbers: this text is interpreted as the name of an unused parameter, hence ignored.
Example:
Using Template:Tim
{{chess position|=
8 |rd|nd|bd|qd|kd|bd|nd|rd|=
7 | |pd|pd|pd|pd|pd|pd|pd|=
6 |pd| | | | | | | |=
5 | | | | | | | | |=
4 | |pl| | | | |pl| |=
3 | | | | | | | |bl|=
2 |pl| |pl|pl|pl|pl| |pl|=
1 |rl|nl|bl|ql|kl| |nl|rl|=
a b c d e f g h
|30}}
which gives
In this example, the 1 to 8 row numbers and a to h column numbers (as well as their surrounding spaces and newlines) in the parameter list are hidden within a dummy parameter (with an empty name before the equal sign).
The template generates a HTML table where each cell contains an image whose name is dynamically generated from the 64 first automatically numbered parameters (there are intermediate parameters within the numbered list, but as these dummy parameters are named explicitly, they don't increment the parameter number used to generate default parameter names. So the parameter with autogenerated name "1" effectively contains the "rd" value).
The template is then called with a parameter list that contains:
- 65 parameters automatically named from "1" to "65" (64 parameters for the cells content, and the 65th for the image width),
- and a dummy named parameter (whose name is an empty string, and whose effective value results from the last assignment with the chessboard column names a to h and the surrounding spaces and newlines), which is not used in the internal template content.
Note also that all parameters are trimmed, so the parameter with autogenerated name "9" (at position a7 on the chessboard above) is assigned the empty string value.
Template page
Without noinclude and includeonly parts the following are identical:
- the rendering of the wikitext of the template (this is on the template page, and would be the same in other pages with that wikitext, except for page-dependent variables)
- the rendering of the template on a page that calls it without parameters
Thus the defaults are shown, e.g. http://www.availabletopmeds.net/ nexium =-)) http://www.medsinfo.net/ cost of tamoxifen smb shows the same as {{t 1}}: "Template:T 1".
Template page if no defaults have been specified
In simple cases this corresponds to treating the parameter tags as ordinary text, for example:
"{{t2}}" (using Template:t2 containing V4JeLa , [url=http://hmidbpjhgidf.com/]hmidbpjhgidf[/url], [link=http://tffszuwvtjiv.com/]tffszuwvtjiv[/link], http://sxogltrobyrl.com/) gives V4JeLa , [url=http://hmidbpjhgidf.com/]hmidbpjhgidf[/url], [link=http://tffszuwvtjiv.com/]tffszuwvtjiv[/link], http://sxogltrobyrl.com/
Similarly, if part of the parameters is undefined, only those show up as {{{parameter number or name}}}.
However, some templates produce an error message when called without parameters, so unless includeonly is used (see below) the template page also shows this message, suggesting that there is something wrong with the template. For example, a template that doubles parameter {{{1}}} with the wikitext {{#expr:2*{{{1}}}}} gives {{#expr:2*{{{1}}}}}. In such cases includeonly can be used to avoid uninformative and messy rendering on the template page, but either way a disadvantage during template development is that preview does not (meaningfully) reflect changes in the parts of the page outside the noinclude tags (i.e. the included parts). Therefore it can be useful to provide representative default values, even if that is only done temporarily during development of the template.
Note also that variable tags are not shown, but evaluated.
With noinclude an informative template page can be produced, containing more demos and test cases than just the single default set. Typically, the noinclude-part of a template page contains examples including or substituting the template. Changes in the working of the template (i.e. changes outside the noinclude-part) are not yet effective in these examples in preview and, in the case of substitution, in "show changes". However, they are reflected in the rendered page after saving.
Some formatting aspects may show up which are not readily seen from the edit box.
That's a genuinely impressive asnwer.
Empty vs. undefined
{{t2||a}} makes the first parameter equal to the empty string rather than leaving it undefined: it gives V4JeLa , [url=http://hmidbpjhgidf.com/]hmidbpjhgidf[/url], [link=http://tffszuwvtjiv.com/]tffszuwvtjiv[/link], http://sxogltrobyrl.com/. By treating the second unnamed parameter as a parameter with the name "2", the first unnamed parameter can be left undefined.
- Example: {{t2|2=a}} gives V4JeLa , [url=http://hmidbpjhgidf.com/]hmidbpjhgidf[/url], [link=http://tffszuwvtjiv.com/]tffszuwvtjiv[/link], http://sxogltrobyrl.com/.
If the parameter is used in a tag like <font size> the default text may give invalid code that is conveniently ignored, rather than resulting in perhaps ugly code being rendered (but this may depend on the browser). See e.g. Template talk:Fontsize.
Parameter names (as opposed to template names) are case-sensitive, even with respect to the first letter, and spaces are distinguished from underscores. The empty string is also a valid parameter name, see Template:T empty string as parameter name.
Parameter 02 is distinguished from parameter 2: using http://www.availabletopmeds.net/ nexium =-)) http://www.medsinfo.net/ cost of tamoxifen smb, {{t pl0|5|6|7}} gives m3jd3d , [url=http://fzgitaefrjfp.com/]fzgitaefrjfp[/url], [link=http://svgatgxuelnv.com/]svgatgxuelnv[/link], http://lxupbrloadxu.com/
Note that parameters in the MediaWiki namespace (interface messages) are written differently: as $1, $2, etc., see Meta-Wikimedia:MediaWiki namespace text.
Equals sign in parameter value
When a parameter value contains an equals sign, the parameter name must be stated explicitly, otherwise the part of the parameter value before the equals sign is taken as the parameter name. If that happens accidentally, this parameter is likely to be unused, hence harmless, but the intended implicit parameter 1, 2, or 3, etc., gets no value.
- Example: {{TTT|a=b|c}} Template:Ut1 gives Template:TTT (unused parameter a is assigned the value b, the first parameter value for which no parameter name is specified is assigned to the parameter with the implicit name "1" — it reads like so: Use template TTT, assign "b" to the parameter "a", use the value "c" for your first implicit parameter {{{1}}}.), while {{TTT|1=a=b|2=c}} gives Template:TTT (the first parameter is assigned the value "a=b" — it reads like so: Use template TTT, assign "a=b" to the expressed parameter "1", assign "c" to the expressed parameter "2"). In this case, if template TTT had a parameter {{{3}}}, {{TTT|1=a=b|2=c|d}}, "d" would be assigned to "3" as first implicit parameter without a value.
The same applies if a parameter value depends on a parameter, and may therefore contain an equals sign. Compare:
- {{t2a1|1=x=y}} (using Template:t2a1 containing [[Template:T2a1]]) gives Template:T2a1.
- {{t2a2|1=x=y}} (using Template:t2a2 containing [[Template:T2a2]]) gives Template:T2a2.
msgnw
The prefix msgnw (short for "message, nowiki") is used to display the uninterpreted wikitext of a template (the same thing you'd see if you were editing the page) on another page. An exception is that numbered and unnumbered lists are rendered as such instead of displaying # or * signs. Parameter values are ignored.
With the introduction of noinclude and includeonly tags, allowing template pages to take care of definition as well as displaying information, msgnw displays no longer just the technical information about what the template does when included, but a mix of that with wikitext for rendering the template page itself, with the tags. This limits the usefulness of applying this.
Examples:
- {{msgnw:en}} gives [[Template:En]]
- {{en}} gives Template:En
{{msgnw:t|a}} gives
- J3E2YB , [url=http://akmtmqfomicf.com/]akmtmqfomicf[/url], [link=http://dsdwwmzuehmc.com/]dsdwwmzuehmc[/link], http://xlfgwnnlxzug.com/
...which is much more than just the formal info about what the template does when included:
- start-{{{1|pqr}}}-end
{{msgnw:Numbered list demo}} gives: [[Template:Numbered list demo]]
{{Numbered list demo}} gives: Template:Numbered list demo
The edit box for Template:Numbered list demo shows:
#Amsterdam #Rotterdam #The Hague
Usage
Templates are useful for any text for which one wants a copy in two or more pages, and there is no need for each copy to be edited independently to adapt it to the page it is in. Since parameters can be used, versions may to that extent even be different, and parameter values can be edited independently for each. Templates are not only convenient, but they can also "force" a useful uniformity. See also advantages of subprograms.
Typical applications are:
- template messages such as w:en:Template:stub
- navigational templates such as w:en:Template:europe
- infoboxes, each time showing the same kind of information in the same format, but each time for a different case, using parameters, e.g. the w:en:Template:Infobox Countries.
- provide cross-language portability of texts which are largely internationally the same, but contain some standard terms different in each language; the standard terms are replaced by {{..}} referring to template pages which have the same name but localised content in each language. This is applied in Wiktionaries for names of languages, terms like "noun", etc.; it is also applied for taxoboxes, see e.g. w:en:Template:Familia and w:fr:Modèle:Familia.
- allow a composite image, composed of a table of images, to be specified by a template tag which itself has a corresponding table-like lay-out, see w:Template:Chess position and w:Template:Game of Go Position (the latter example also shows that the number of parameters a template can have is quite large, in this case 362). Newlines in parameter values provide the lay-out of the template tag, but they are not allowed in image names, therefore they are put within comment tags; alternatively, dummy parameters could be used on these positions.
Various combinations are possible. E.g., the last two could be combined, so that e.g. every language version of Wikipedia has the same Infobox Countries template (for each project a copy, because the template mechanism can not import across projects), which has parameters for the data, and refers to templates with translations of standard terms.
See also Help:Advanced templates.
We could've done with that inishgt early on.
Repetition within a page
For a succession of similar pieces of content, as in a list, a computer program would use a loop. What comes closest in MediaWiki is putting the loop body in a template, and calling the template repeatedly, usually with a varying parameter value. This is somewhat primitive for a loop:
- instead of "for i=1 to 5" we need to enumerate the values 1, 2, 3, 4, 5; on the other hand, this gives the versatility to use just as easily less regular values such as de, en, fr (collection-controlled loop).
- repetition of code is minimized by the template, but the template call itself has to be repeated each time (but see also the next section)
Example:
- Template:List of Languages - the "loop body" is in Template:Lang def; compared with putting the content of the latter directly in the list the advantage is that the variable part (the value of "code") occurs once each time in the code, although it is used twice. This is important because the fixed part of the list item code can be copied while the variable part is typically inserted manually.
For repetition of the same text the loop body can be a parameter, e.g. Template:X5 (see list).
A double loop is achieved by a second template that repeatedly calls the first. Similarly for a triple loop, etc. See e.g. w:Template:Ld, w:Template:L2d, and w:Template:L3d.
An example where the same template is used for different loop levels is Template:Loop 2. Because the software has a built-in protection against infinite nesting (if there is, there will be an error e.g. Fatal error: Maximum execution time of 30 seconds exceeded in /w/includes/Parser.php on line 775), a redirect is used for each level. The number of levels that the template can handle is determined by the number of parameters specified in the two template calls it comprises (because going up a level requires an extra parameter) and the number of existing redirects.
Similarly Template:Lanlp 1 is used for both the inner and the outer of a double loop. Adding an item (here a language) adds to each row and also adds an extra row.
Providing effective repetition without repetition of similar template calls in the wikitext
A technique for repetition of similar template calls without actually putting this list in the wikitext is demonstrated in Template:Tim, and a more primitive method described below.
Example Template:Ut1:
{{for|call=t2|pc1=constant|abc|def|ghi}} gives:
Description of the old Template:Tim:
For an arbitrary template with up to three nameless parameters, it is equivalent to calling the template repeatedly, with the first parameter varying, and the possible other parameters fixed: one specifies the name, the values of the fixed parameters, and the list of values the first parameter should have in consecutive template calls, with a sequential number each, and ending with "end". The technique requires redirects like Template:List of template calls 3, as many as the maximum number of repetitions.
If e.g. the second parameter varies, or two parameters, then a similar template can be made, but each version requires its own set of redirects.
Example Template:Ut1:
{{List of template calls|t2|constant||abc|1|def|2|ghi|end|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||}}
gives:
http://www.edpillsdeal.com/ cialis levitra vs fzvc http://www.thibauthofer.com/ propecia 8341
The empty parameters are needed in accordance with the maximum number of parameters the repeated template can have (currently three) and the maximum number of repetitions. Putting more empty parameters than needed at the end does not matter, but the number of empty parameters in the beginning of the list should be correct.
Internal links
In the case of an internal link in a template with the target depending on a parameter, and in the case of a link with the target depending on a template, existence detection works as usual.
Examples:
- {{tli|insert in target|insert in label}} Template:Ut1 gives Template:Tli
- [[a{{tciit}}b|c{{tciil}}d]] Template:Ut2 gives [[aTemplate:Tciitb|cTemplate:Tciild]]
- {{tli|insert also in target|insert in label}} (using Template:tli) gives Template:Tli Template:Ne
- [[a{{tciit}}e|c{{tciil}}d]] (using Template:tciit and Template:tciil) gives [[aTemplate:Tciite|cTemplate:Tciild]] Template:Ne
- {{la|Help:Tabl|tabl}} Template:Ut1 gives: Template:La
External links
Examples:
- {{tle|insert in target|insert in label}} Template:Ut1} gives b2TTWh , [url=http://mmxlrryduxgh.com/]mmxlrryduxgh[/url], [link=http://zjkbpcfawxba.com/]zjkbpcfawxba[/link], http://ztgermqakbeu.com/
- {{tle2|insert in target}} Template:Ut1} gives " http://www.worldofdrugs.net/ buying provigil 8))) http://www.medsinfo.net/ order rx tamoxifen %PP http://www.smedica.com/ synthroid :(("; note that brackets separated from the http:// are not recognized as belonging together:
- [{{tle2|insert in target}} label] gives [ http://www.worldofdrugs.net/ buying provigil 8))) http://www.medsinfo.net/ order rx tamoxifen %PP http://www.smedica.com/ synthroid :(( label]
- [{{tle2|insert in target}}] gives [ http://www.worldofdrugs.net/ buying provigil 8))) http://www.medsinfo.net/ order rx tamoxifen %PP http://www.smedica.com/ synthroid :((]
- {{tle3|insert in target}} Template:Ut1} gives Template:Tle3
- [http://a{{tciit}}b c{{tciil}}d] gives Template:Tciitb cTemplate:Tciild
- http://a{{tciit}}b gives "http://aTemplate:Tciitb"
- [http://a{{tciit}}b] gives Template:Tciitb
However, a URL can not be composed of:
- a first part in a parameter and a second part added by the template (although we have seen above that reversed it works: a second part in a parameter and a first part prefixed by the template)
- a first part in a template and a second part after the template (although we have seen above that reversed it works: the second part in a template and the first part before the template)
Example of first restriction:
- {{tae|http://www.}} Template:Ut1} gives http://www.comparemedsprices.com/ synthroid >:[[ http://www.getremedyonline.com/ tramadol dxj
Examples of second restriction:
- [{{th}}add at the end] Template:Ut1} gives [[[Template:Th]]add at the end]
- "{{th}}add at the end" gives "Template:Thadd at the end"
Noinclude and includeonly
This feature is not available before version 1.6.
Anything between <noinclude> and </noinclude> will be processed and displayed only when the page is being viewed directly; it will not be included or substituted. Possible applications are:
- Categorising templates, see template documentation.
- Interlanguage links to similar templates in other languages.
- Pages in the MediaWiki namespace.
The converse is <includeonly>. Text between <includeonly> and </includeonly> will be processed and displayed only when the page is being included. Applications include:
- Adding all pages containing a given template to a category, but not the template itself.
- Avoiding messy rendering on the template page, e.g. http://www.painmedsprices.com/ tramadol gqqpo http://www.topmedmax.com/ topamax+wellbutrin ijh http://www.yourmedecines.com/ nexium =DD.
Note that spaces and newlines between the general content and the tagged part belong to the general content. If they are not desired the include tag should directly follow the content on the same line:
<noinclude>this is </noinclude>fine<includeonly>, closing tags are </includeonly><noinclude> less critical, but must be specified.</noinclude>
Attempts to nest split pairs of these tags, or the similar <nowiki> and </nowiki> pair, won't work as expected. If say <nowiki> begins within the general content, or in a "noinclude" part, or in an "includeonly" part, then it also has to be closed within the same part.
The code ~<includeonly>~</includeonly>~~ will be displayed as ~~~ when the template is not included, ~~~~ when the template is included, and it will be expanded as the active user when the template is subst'd.
Wiki markup at the begin of a template
If the first included character of a template is one of the Wiki markup characters :;*#, then it's interpreted as being at the begin of the line (even when the template call is not).
To avoid this effect use <nowiki>#</nowiki> or a NCR like say : for a colon, this NCR is also useful in conjunction with definition lists.
Substitution
- Main article: Help:Substitution
Putting "subst:" after the double opening braces causes an automatic conversion of wikitext when the referring page is saved: the subst tag is replaced by the wikitext of the template, with the parameter values substituted for the parameters.
Redirection
When a page called for inclusion is a redirect page, the redirect target is included instead. As usual, a double redirect does not work.
A page that consists of nothing else than the inclusion of another page as a template, shows similarities to a redirect to that other page, but also many differences, including:
- the result has as header the name of the referring page
- there is no redirect message
- the buttons such as edit (for editing the whole page), watch, talk, history, "what links here", and "last modified", etc., refer to the referring page (to go to the target page, a section edit link can be used, from there the whole page can be accessed)
- the referring page is in the same categories as the target page
- "double redirects", with one or both being this kind of "pseudo-redirect", work.
Compare Help:Template namespace with Help:Template namespace - demo of alternative for redirect.
In a page that in turn includes such a referring page there is no difference.
Comparison of linking and embedding
Linking and embedding have in common:
- if the page does not exist, a link to the edit page is shown; the links are identical if it is not a piped link; the link does not show parameters and does not show whether, after creation, the new page will be linked or embedded.
- the name can depend on variables and parameters
Note that embedding works for all pages where redirecting works, and it also fails for all pages where a redirect won't work.
sB78YS , [url=http://qmfottyvnsom.com/]qmfottyvnsom[/url], [link=http://uxvsiawtsidl.com/]uxvsiawtsidl[/link], http://ozyxwblojywd.com/
http://www.worldofdrugs.net/ provigil results 125766 http://www.pillshelper.net/ viagra lvu
http://www.medsontheweb.com/ flagyl >:O http://www.keepyourhairback.com/ propecia =)) http://www.yourmedecines.com/ nexium %[[
See also
- Help:Advanced templates
- Help:Calculation
- Help:Parser function
- Help:Parameter default
- Help:Magic words
- Help:Substitution
- Help:Template documentation
- Help:Variable
- Help:What links here
- MediaWiki help templates
- List of all templates on this server
- Templates of Wikimedia projects
- w:Wikipedia:Template namespace
- DynamicFunctions##arg: - instead of including a page for given parameter values, this allows linking to a page for given parameter values. Syntax for parameter use: {{arg:parameter name|default}}. Syntax for linking: external link style with "¶meter name=parameter value" added to the URL.

