Zum Inhalt springen

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

keine Bearbeitungszusammenfassung
(fixes, da Vorlage substcheckbottom gelöscht)
Keine Bearbeitungszusammenfassung
Zeile 13: Zeile 13:
<code><nowiki>{{{{{|safesubst:}}}subst check bottom|subst={{{subst|}}}}}</nowiki></code>
<code><nowiki>{{{{{|safesubst:}}}subst check bottom|subst={{{subst|}}}}}</nowiki></code>


{{#switch: {{BASEPAGENAME}} | Subst check top=This template, along with {{tl|substcheckbottom}}, | Subst check bottom=This template, along with {{tl|substchecktop}}, | #default=These templates }} will check the main template for substitution and give an error message if it has been accidentally transcluded by having {{#ifeq: {{BASEPAGENAME}} | Subst check top | this template | {{tl|substchecktop}} }} placed above the main template code and {{#ifeq: {{BASEPAGENAME}} | Subst check bottom | this template | {{tl|substcheckbottom}} }} placed below the main template code.
{{#switch: {{BASEPAGENAME}} | Subst check top=This template, along with {{tl|subst check bottom}}, | Subst check bottom=This template, along with {{tl|subst check top}}, | #default=These templates }} will check the main template for substitution and give an error message if it has been accidentally transcluded by having {{#ifeq: {{BASEPAGENAME}} | Subst check top | this template | {{tl|subst check top}} }} placed above the main template code and {{#ifeq: {{BASEPAGENAME}} | Subst check bottom | this template | {{tl|subst check bottom}} }} placed below the main template code.


{{#ifeq: {{BASEPAGENAME}} | Subst check top | 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 refers 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. {{#ifeq: {{BASEPAGENAME}} | Subst check bottom | This template | {{tl|substcheckbottom}} }} takes in an input for categories. This is so that unsubstituted versions of the main template can still categorise pages. This can be done by adding the name of the category to the category parameter. There is also a sort parameter to allow category sorting.
{{#ifeq: {{BASEPAGENAME}} | Subst check top | This template | {{tl|subst check top}} }} 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 refers 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. {{#ifeq: {{BASEPAGENAME}} | Subst check bottom | This template | {{tl|subst check bottom}} }} takes in an input for categories. This is so that unsubstituted versions of the main template can still categorise pages. This can be done by adding the name of the category to the category parameter. There is also a sort parameter to allow category sorting.


Both {{#switch: {{BASEPAGENAME}} | Subst check top=this template and {{tl|substcheckbottom}} | Subst check bottom=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 nosubst.
Both {{#switch: {{BASEPAGENAME}} | Subst check top=this template and {{tl|subst check bottom}} | Subst check bottom=this template and {{tl|subst check top}} | #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 nosubst.


{{List of subst helper templates}}
{{List of subst helper templates}}
Anonymer Benutzer