Difference between revisions of "Template:Commons file"
imported>Plastikspork (Updating {{tfd}} template: template was relisted (using TFDcloser)) |
imported>Mclay1 (simplifying) |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
| − | + | <includeonly>[[File:Commons-logo.svg|15px]] Wikimedia Commons has [[{{#ifeq:{{{p}}}|c|c}}:File:{{{1}}}|a file]] available{{#if:{{{2|}}}| for {{{2}}}}}.</includeonly><noinclude> | |
| − | + | {{Commons file|Wikipedia-logo-v2.svg|this logo}} | |
| − | {{ | + | {{Documentation|content= |
| − | {{ | ||
Template {{bxtn|commons file}} implements and formats inline links to pages at the [[Help:Files|file:]] namespace. By default, the template displays a Wikimedia icon, pre-inserted text, and trailing punctuation, as well as static link text. Appended text may also be included. Several of the default options may be edited by the user. | Template {{bxtn|commons file}} implements and formats inline links to pages at the [[Help:Files|file:]] namespace. By default, the template displays a Wikimedia icon, pre-inserted text, and trailing punctuation, as well as static link text. Appended text may also be included. Several of the default options may be edited by the user. | ||
==Usage== | ==Usage== | ||
| − | |||
===Structure=== | ===Structure=== | ||
In the box below. for presentation purposes only, required parameters are in {{bxtn|bold}}; [brackets] indicate parameter values; variables are {{em|italicized}}. | In the box below. for presentation purposes only, required parameters are in {{bxtn|bold}}; [brackets] indicate parameter values; variables are {{em|italicized}}. | ||
{{csdoc|usage full}} | {{csdoc|usage full}} | ||
| − | :<code><nowiki>{{commons file|</nowiki>[{{bxtn|{{var|filename}}}}]<nowiki>|</nowiki>[{{var|appended text}}]<nowiki> | + | :<code><nowiki>{{commons file|</nowiki>[{{bxtn|{{var|filename}}}}]<nowiki>|</nowiki>[{{var|appended text}}]<nowiki>|p= }}</nowiki></code> |
{{end}} | {{end}} | ||
Copy a blank version to use. All parameter names must be in lowercase. Use the "{{!}}" (pipe) character between each parameter. Leading and trailing spaces ( ) are trimmed from parameter values; therefore, parameters will not display if they are only populated by spaces. By default, displayed values are separated by a single [[whitespace character]]. Delete unused parameters. See {{slink||Parameters}} for important details. | Copy a blank version to use. All parameter names must be in lowercase. Use the "{{!}}" (pipe) character between each parameter. Leading and trailing spaces ( ) are trimmed from parameter values; therefore, parameters will not display if they are only populated by spaces. By default, displayed values are separated by a single [[whitespace character]]. Delete unused parameters. See {{slink||Parameters}} for important details. | ||
==Parameters== | ==Parameters== | ||
| − | + | There are two ordered anonymous parameters; the target file page parameter (<code>[[#fname|[1]]]</code>) is {{em|required}}. | |
| − | |||
| − | |||
| − | There are two ordered anonymous parameters; the target file page parameter (<code>[[#fname|[1]]]</code>) is {{em|required}}. | ||
| − | |||
*{{anchor|fname}}{{bxtn|[1]}} (filename): use the first anonymous parameter for the filename of an associated [[Help:Files|file: namespace]] page, which becomes the target file page. Enter the file's name, including its extension, in plain text{{spaced en dash}}{{em|do not}} enter the [[wp:namespace|namespace prefix]] ("file:" or "image:"). Do not use any formatting or special editing. This parameter is {{em|required}}; output will not display otherwise. | *{{anchor|fname}}{{bxtn|[1]}} (filename): use the first anonymous parameter for the filename of an associated [[Help:Files|file: namespace]] page, which becomes the target file page. Enter the file's name, including its extension, in plain text{{spaced en dash}}{{em|do not}} enter the [[wp:namespace|namespace prefix]] ("file:" or "image:"). Do not use any formatting or special editing. This parameter is {{em|required}}; output will not display otherwise. | ||
:{{em|Note:}} the default link is to the {{em|local copy}} of the Commons file page; for linking to the original, see parameter {{bxt|p}} [[#cp|below]]. | :{{em|Note:}} the default link is to the {{em|local copy}} of the Commons file page; for linking to the original, see parameter {{bxt|p}} [[#cp|below]]. | ||
*{{bxtn|[2]}} (postscript): use the second anonymous parameter to append optional explanatory text that displays {{em|after}} the link to the target file page. | *{{bxtn|[2]}} (postscript): use the second anonymous parameter to append optional explanatory text that displays {{em|after}} the link to the target file page. | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
*{{anchor|cp}}{{bxtn|p}} (project): by default, the link to the file page targets the Wikipedia copy; set {{para|p|c}} to link the original at Wikimedia Commons. | *{{anchor|cp}}{{bxtn|p}} (project): by default, the link to the file page targets the Wikipedia copy; set {{para|p|c}} to link the original at Wikimedia Commons. | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
[[Category:Exclude in print]] | [[Category:Exclude in print]] | ||
[[Category:Interwiki category linking templates]] | [[Category:Interwiki category linking templates]] | ||
[[Category:Interwiki link templates]] | [[Category:Interwiki link templates]] | ||
[[Category:Wikimedia Commons templates]] | [[Category:Wikimedia Commons templates]] | ||
| − | </noinclude> | + | }}</noinclude> |
Latest revision as of 06:38, 2 February 2017
Wikimedia Commons has a file available for this logo.
Template commons file implements and formats inline links to pages at the file: namespace. By default, the template displays a Wikimedia icon, pre-inserted text, and trailing punctuation, as well as static link text. Appended text may also be included. Several of the default options may be edited by the user.
Usage
Structure
In the box below. for presentation purposes only, required parameters are in bold; [brackets] indicate parameter values; variables are italicized.
|
Copy a blank version to use. All parameter names must be in lowercase. Use the "|" (pipe) character between each parameter. Leading and trailing spaces ( ) are trimmed from parameter values; therefore, parameters will not display if they are only populated by spaces. By default, displayed values are separated by a single whitespace character. Delete unused parameters. See Script error: No such module "Section link". for important details.
Parameters
There are two ordered anonymous parameters; the target file page parameter ([1]) is required.
- [1] (filename): use the first anonymous parameter for the filename of an associated file: namespace page, which becomes the target file page. Enter the file's name, including its extension, in plain textTemplate:Spaced en dashdo not enter the namespace prefix ("file:" or "image:"). Do not use any formatting or special editing. This parameter is required; output will not display otherwise.
- Note: the default link is to the local copy of the Commons file page; for linking to the original, see parameter p below.
- [2] (postscript): use the second anonymous parameter to append optional explanatory text that displays after the link to the target file page.
- p (project): by default, the link to the file page targets the Wikipedia copy; set
|p=cto link the original at Wikimedia Commons.
| Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Subpages of this template. |