Template

Templ/doc

< Template:Templ
Revision as of 13:49, 4 May 2021 by WikiLucas00 (talk | contribs) (Created page with "== Notice d’utilisation == This template, {{templ|templ}}, allows to show the name of a template and a link to this template, to be able to directly copy the template shown...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Notice d’utilisation

This template, {{templ}}, allows to show the name of a template and a link to this template, to be able to directly copy the template shown without needing the writer to use "nowiki" and "code" tags.

Parameters
1 Name of the target template, without curly brackets
inter Optional. Interwiki. For instance, to specify a template from en.wiktionary, we will use inter=en:Template:. This parameters allows to reach other wiki projects, like fr.wikipedia (see 3rd example below). Note: this parameter works differently from inter parameter, used on en.wikt.
prefix Optional. For compatibility with en.wikt only (unused if inter is used): only mentions interwiki prefix, not the namespace (to put in an anonymous parameter (see 4th and 5th examples below). This prefix won't be displayed.
2 et
3
Optionals. Examples of values for positional parameters for the template. They will be displayed along the template's name.

NB: In the case where the name of the template (or one of its optional parameters) contains a "=", we must explicitly name these positional parameters with "1=" (or "2=", etc.) placed before the given value, cf. example 2. It is also possible to name the "=" with {{=}}.

Template

Empty template Example Result
{{templ| }} {{templ|S}} {{S}}
{{templ|1==fr=}} {{=fr=}}
{{templ|inter=w:fr:Modèle:|templ}} {{templ}}

Examples of parameters compatibility with English Wiktionary and Commons

These examples use the parameters of the "temp" template from en.wikt, or "tl" from Commons and en.wikipedia. The interwiki prefix is separated from the namespace within the target wiki, however the anonymous parameter should only be used to force ":"

Target wiki Target namespace Example Result
Wikimedia Commons Templates {{templ|prefix=commons:|tl}} {{tl}}
English wikipedia {{templ|prefix=w:en:|tl}} {{tl}}
English wiktionary {{templ|prefix=en:|temp}} {{temp}}
French wikipedia (compatible) {{templ|prefix=w:|M}} {{M}}
French wikipedia (preferable) {{templ|prefix=w:|=Modèle:|M}} {{M}}
Wikimedia Commons Main space {{templ|prefix=commons:|=:|Main Page}} {{:Main Page}}
English wikipedia {{templ|prefix=w:en:|=:|Main Page}} {{:Main Page}}
French wikipedia {{templ|prefix=w:|=:|Accueil}} {{:Accueil}}
Wikimedia Commons Others {{templ|prefix=commons:|=:|Category:Languages}} {{:Category:Languages}}
English wikipedia {{templ|prefix=w:en:|=:|Category:Languages}} {{:Category:Languages}}
English wiktionary {{templ|prefix=en:|=:|Category:Languages}} {{:Category:Languages}}
English wikipedia {{templ|prefix=w:|=:|Catégorie:Langues}} {{:Catégorie:Langues}}
French wiktionary {{templ|=:|Catégorie:Langues}} {{:Catégorie:Langues}}