Zum Inhalt springen

Vorlage:Subst check top/Doku: Unterschied zwischen den Versionen

Added Text
imported>Thesevenseas
(Fixed Code)
imported>Thesevenseas
(Added Text)
Zeile 3: Zeile 3:


=== Usage ===
=== Usage ===
Place {{#switch: {{BASEPAGENAME}} | Substchecktop=this template and {{tl|substcheckbottom}} | Substcheckbottom=this template and {{tl|substchecktop}} | #default=these templates }} onto the main template in the following manner.


<code><nowiki>{{{{{|safesubst:}}}substchecktop|[template pagename]|subst={{{subst|}}}}}</nowiki></code>
<code><nowiki>{{{{{|safesubst:}}}substchecktop|[template pagename]|subst={{{subst|}}}}}</nowiki></code>
Zeile 10: Zeile 12:
<code><nowiki>{{{{{|safesubst:}}}substcheckbottom|subst={{{subst|}}}}}</nowiki></code>
<code><nowiki>{{{{{|safesubst:}}}substcheckbottom|subst={{{subst|}}}}}</nowiki></code>


{{#switch: {{BASEPAGENAME}} | Substchecktop=This template, along with {{tl|substcheckbottom}}, is | Substcheckbottom=This template, along with {{tl|substchecktop}}, is | #default=These templates are }} designed to check templates for substitution and give an error message if they have been accidentally transcluded.
{{#switch: {{BASEPAGENAME}} | Substchecktop=This template, along with {{tl|substcheckbottom}}, | Substcheckbottom=This template, along with {{tl|substchecktop}}, | #default=These templates }} will the main template for substitution and give an error message if it has been accidentally transcluded. {{#ifeq: {{BASEPAGENAME}} | Substchecktop | This template | {{tl|substchecktop}} }} is placed above the template code and {{#ifeq: {{BASEPAGENAME}} | Substcheckbottom | This template | {{tl|substcheckbottom}} }} is placed below the template code.
 
{{#ifeq: {{BASEPAGENAME}} | Substchecktop | This template | {{tl|substchecktop}} }} takes in an input for the main template name as a parameter This is shown above as <code><nowiki>[template pagename]</nowiki></code>. This parameter should be entered so that the default error message refer to the correct main template. This default error message can be optionally replaced by a custom error message by using the message parameter. This parameter accepts templates and it is recommended that a message template be used for long messages to keep the parameter value short. These parameters are not used in {{#ifeq: {{BASEPAGENAME}} | Substcheckbottom | this template | {{tl|substcheckbottom}} }}.
 
Both {{#switch: {{BASEPAGENAME}} | Substchecktop=this template and {{tl|substcheckbottom}} | Substcheckbottom=this template and {{tl|substchecktop}} | #default=these templates }} use <code><nowiki>subst={{{subst|}}}</nowiki></code> as one of the parameters. This allows optional transclusion for demonstration purposes by setting the subst parameter on the main template to any value.


=== See also ===
=== See also ===
{{#ifeq: {{BASEPAGENAME}} | Substchecktop | {{tl|substchecktop}} }}
{{#ifeq: {{BASEPAGENAME}} | Substcheckbottom | {{tl|substcheckbottom}} }}


<includeonly>
<includeonly>
Anonymer Benutzer