Template:Iffile/doc: Difference between revisions
rmv, does not belong on /doc |
Tacsipacsi (talk | contribs) add documentation for parameter 2, use TemplateData, Template:FNO now redirects here |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<includeonly>{{heavily used template|3=+}}</includeonly> |
|||
{{TemplateBox |
{{TemplateBox |
||
|1=1 |
|1=1 |
||
|1label-en=file namespace |
|||
|1d={{Mld |
|||
|en=The wikitext to display if the test conclusive |
|1d-en=The wikitext to display if the test is conclusive |
||
|fr=Le wikitexte à afficher si le test est concluant |
|1d-fr=Le wikitexte à afficher si le test est concluant |
||
|1type=content |
|||
}} |
|||
|1def= |
|1def= |
||
|1stat=required |
|1stat=required |
||
|2=2 |
|||
|2label-en=non-file namespace |
|||
|2d-en=The wikitext to display if the test isn’t conclusive |
|||
|2type=content |
|||
|2def= |
|||
|2stat=optional |
|||
|name=Iffile |
|name=Iffile |
||
⚫ | |||
|desc={{Mld |
|||
⚫ | |||
⚫ | |||
⚫ | |||
}} |
|||
|namespace=all |
|namespace=all |
||
|usergroup=all |
|usergroup=all |
||
|placement= |
|placement= |
||
|usage-notes=Short for <code><nowiki>{{#ifeq:{{NAMESPACE}}|File|</nowiki></code>...<code><nowiki>}}</nowiki></code> |
|usage-notes=Short for <code><nowiki>{{#ifeq:{{NAMESPACE}}|File|</nowiki></code>...<code><nowiki>}}</nowiki></code>,<br> |
||
{{0|Shortf}} or <code><nowiki>{{#ifeq:{{NAMESPACENUMBER}}|6|</nowiki></code>...<code><nowiki>}}</nowiki></code>. |
|||
Intended usage is for templates that should categorise only when used in File namespace. |
Intended usage is for templates that should categorise only when used in File namespace. |
||
Line 22: | Line 30: | ||
|i18n-method=- |
|i18n-method=- |
||
|i18n-desc= |
|i18n-desc= |
||
|seealso=*{{tl|Iffileorcategory}} |
|seealso= |
||
* {{tl|Iffileorcategory}} |
|||
* {{tl| |
* {{tl|Category}} |
||
|setscats= |
|setscats= |
||
|lines=one |
|lines=one |
||
|shorthand= |
|shorthand= |
||
|relieson= |
|relieson= |
||
|useTemplateData=only |
|||
}} |
}} |
||
<includeonly>[[Category:Function templates |
<includeonly>[[Category:Function templates]]</includeonly> |
Latest revision as of 20:36, 6 October 2022
Shorthand to display something only in the File namespace
Usage
{{Iffile |1= |2= }}
Short for {{#ifeq:{{NAMESPACE}}|File|
...}}
,
or {{#ifeq:{{NAMESPACENUMBER}}|6|
...}}
.
Intended usage is for templates that should categorise only when used in File namespace.
Template parameters
- TemplateData
TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard.
Existing template documentation
At Wikimedia Commons, it is recommended to use {{TemplateBox}} with either useTemplateData=1
or useTemplateData=only
on the /doc
subpage and transcluding it with {{Documentation}} into the template. <nowiki>
-tags can be wrapped around the arguments, if required, to avoid templates being expanded.
Newly created template documentation and imports
Another option, especially for imported templates, or for users with JSON experience, is placing raw <templatedata>
-tags into the Wikitext of the template, as described in various Wikipediae.
Wikipedia's help about TemplateData • Commons-specific information
Shorthand to display something only in the File namespace
Parameter | Description | Type | Status | |
---|---|---|---|---|
file namespace | 1 | The wikitext to display if the test is conclusive | Content | required |
non-file namespace | 2 | The wikitext to display if the test isn’t conclusive | Content | optional |
Additional information
The template is intended to be used in the following namespaces: all namespaces
The template is intended to be used by the following user groups: all users
See also
Localization
This template is not intended to be localized.