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

Aus skandinavien-wiki.net
imported>Thesevenseas
(Optimised Code)
K (27 Versionen von wikivoyage:Vorlage:Subst_check_top/Doku importiert)
 
(22 dazwischenliegende Versionen von 8 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
{{Documentation subpage}}
{{Bitte um Übersetzung|en}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
{{Dokumentation Unterseite}}
<!-- Kategorien bitte an das Ende der Seite, Interwiki-Links bitte nach Wikidata. Danke! -->


=== 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.
Place {{#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 }} onto the main template in the following manner.


<code><nowiki>{{{{{|safesubst:}}}substchecktop|[template pagename]|subst={{{subst|}}}}}</nowiki></code>
<code><nowiki>{{{{{|safesubst:}}}subst check top|[template pagename]|subst={{{subst|}}}}}</nowiki></code>


<code><nowiki>...template code...</nowiki></code>
<code><nowiki>...template code...</nowiki></code>


<code><nowiki>{{{{{|safesubst:}}}substcheckbottom|subst={{{subst|}}}}}</nowiki></code>
<code><nowiki>{{{{{|safesubst:}}}subst check bottom|subst={{{subst|}}}}}</nowiki></code>


{{#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.
{{#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}} | 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}} }}.
{{#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}} | 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.
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.


=== See also ===
{{List of subst helper templates}}
 
<includeonly><!-- Kategorien bitte hier, Interwiki-Links bitte nach Wikidata -->
*{{#ifeq: {{BASEPAGENAME}} | Substchecktop || [[Template:Substchecktop|Substchecktop]] }}
{{#ifeq:{{PAGENAME}}|{{BASEPAGENAME}}|
*{{#ifeq: {{BASEPAGENAME}} | Substcheckbottom || [[Template:Substcheckbottom|Substcheckbottom]] }}
[[Kategorie:Vorlagen:Vorlagenersetzung|Subst check]]
 
}}</includeonly>
<includeonly>
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
 
</includeonly>

Aktuelle Version vom 11. Februar 2023, 21:39 Uhr

Usage

Place this template and {{subst check bottom}} onto the main template in the following manner.

{{{{{|safesubst:}}}subst check top|[template pagename]|subst={{{subst|}}}}}

...template code...

{{{{{|safesubst:}}}subst check bottom|subst={{{subst|}}}}}

This template, along with {{subst check bottom}}, will check the main template for substitution and give an error message if it has been accidentally transcluded by having this template placed above the main template code and {{subst check bottom}} placed below the main template code.

This template takes in an input for the main template name as a parameter. This is shown above as [template pagename]. 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. {{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 this template and {{subst check bottom}} use subst={{{subst|}}} as one of the parameters. This allows optional transclusion for demonstration purposes by setting the subst parameter on the main template to nosubst.

Verwandte Vorlagen

Liste von Substitutions-Hilfsvorlagen
  • {{require subst}}: Gibt eine Fehlermeldung aus, wenn eine Vorlage nicht substituiert wird.
    • {{subst check top}}、{{subst check bottom}}: Gleicher Zweck, aber als Paar verwendet.
    • {{subst only}}: Hinweistext, für obige Vorlagen, der um eine Vorlagenersetzung bittet.
    • {{nosubst}}: Das Gegenteil {{subst only}}. Bitte darum, nicht zu ersetzen.
    • {{added by substitution}}: Setzt in einer Vorlegendokumentation einen Hinweis, dass die Vorlage nicht direkt eingebunden wird, sondern durch Ersetzung mittels einer anderen Vorlage in den Artikel aufgenommen wird.
  • {{issubst}}: Gibt ein yes zurück, wenn eine Vorlage bei der Einbindung nicht ersetzt wurde.
  • {{ifsubst}}: Verzweigt die Abarbeitung, je nachdem, ob ersetzt wurde oder nicht.