Difference between revisions of "Template:Commons file"

From blackwiki
Jump to navigation Jump to search
(Prelim. doc update.)
(+{{{p}}}, continuing with doc.)
Line 1: Line 1:
<!--Begin {{commons file}}.--><includeonly>{{#if:{{{1|}}}|{{#ifeq:{{{icon}}}|n||[[File:Commons-logo.svg|15px]]&#160;}}Wikimedia Commons has&#32;[[:File:{{{1|}}}|a file]]&#32;available{{#if:{{{2|}}}|&#32;for {{{2|}}}}}{{{term|.}}}}}</includeonly><!--End {{commons file}}.--><noinclude>
+
<!--Begin {{commons file}}.--><includeonly>{{#if:{{{1|}}}|{{#ifeq:{{{icon}}}|n||[[File:Commons-logo.svg|15px]]&#160;}}Wikimedia Commons has&#32;[[{{#ifeq:{{{p}}}|c|c}}:File:{{{1|}}}|a file]]&#32;available{{#if:{{{2|}}}|&#32;for&#32;{{{2|}}}}}{{{term|.}}}}}</includeonly><!--End {{commons file}}.--><noinclude>
{{commons file|Winsor McCay - Dream of the Rarebit Fiend 1910-08-21.png|this comic strip}}
+
{{commons file|Wikipedia-logo-v2.svg|this logo}}
 
{{documentation|content=
 
{{documentation|content=
Template {{bxtn|commons file}} implements and formats inline links to files at [[commons:|Wikimedia Commons]]. By default, the link is preceded by the Wikimedia icon and pre-inserted explanatory text, and displays with the static link text "a file"; appended text may be included, followed by trailing punctuation. Several of the default options may be edited by the user.
+
Template {{bxtn|commons file}} implements and formats inline links to file 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}}; explanatory text is in (parentheses).
+
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|icon= |</nowiki>[{{bxtn|{{var|filename}}}}]<nowiki>|</nowiki>[{{var|appended text}}]<nowiki>|term= }}</nowiki></code>
+
:<code><nowiki>{{commons file|</nowiki>[{{bxtn|{{var|filename}}}}]<nowiki>|</nowiki>[{{var|appended text}}]<nowiki>|icon= |p= |term= }}</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 (&#160;) 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 (&#160;) 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.
Line 17: Line 17:
  
 
===Anonymous parameters===
 
===Anonymous parameters===
There are two ordered anonymous parameters; the target file parameter (<code>[[#fname|[1]]]</code>) is {{em|required}}.<br/>
+
There are two ordered anonymous parameters; the target file page parameter (<code>[[#fname|[1]]]</code>) is {{em|required}}.<br/>
 
In order of usage:
 
In order of usage:
*{{anchor|fname}}{{bxtn|[1]}} (filename): use the first anonymous parameter for the name of an existing Wikimedia File: which becomes the target file. Enter filename (including its extension) in plain text{{spaced en dash}}{{em|do not}} use any formatting or special editing. This parameter is {{em|required}}.
+
*{{anchor|fname}}{{bxtn|[1]}} (filename): use the first anonymous parameter for the filename of an associated Wikimedia file page, which becomes the target filepage. Enter the file's name including its extension in plain text{{spaced en dash}}{{em|do not}} enter the [[wp:namespace|namespace]] "File:" or use any formatting or special editing. This parameter is {{em|required}}; output will not display otherwise.
*{{bxtn|[2]}} (postscript): use the second anonymous parameter to append explanatory text that displays {{em|after}} the target file link.
+
:{{em|Note:}} the default link is to the {{em|local copy}} of the Commons file page; see [[#cp|{{para|p}}]] below to link the original file.
 +
 
 +
*{{bxtn|[2]}} (postscript): use the second anonymous parameter to append optional explanatory text that displays {{em|after}} the target file page link.
  
 
===Display parameters===
 
===Display parameters===
*{{bxtn|icon}}: set {{para|icon|n}} to suppress display of the Wikimedia icon.
+
All optional.
*{{anchor|tp}}{{bxtn|term}} (termination): use this parameter to add trailing (terminating) punctuation to the template's output.
+
*{{bxtn|icon}} (logo): by default, the Wikimedia logo displays first, as a 15px icon ([[File:Commons-logo.svg|15px]]); set {{para|icon|n}} to suppress its display.
 +
*{{bxtn|term}} (termination): by default, the template inserts a full stop as trailing (terminating) punctuation; use this parameter to replace or remove it.
 +
 
 +
===Other parameters===
 +
*{{anchor|cp}}{{bxtn|p}} (project): by default, the file page link targets the Wikipedia copy; optionally, set {{para|p|c}} to link the original Wikimedia Commons filepage.
 +
 
 +
==Static text==
 +
The static text output by the template is quoted in the box below. For presentation purposes only, the link text to the target filepage is formatted as a non-linking example.
 +
{{quote box|quote=Wikimedia Commons has <span style="color:#0645AD; text-decoration:underline">a file</span> available|fontsize=100|align=left}}{{clear}}
  
 
==Examples==
 
==Examples==
 +
 +
==See also==
  
 
}}
 
}}

Revision as of 21:22, 16 August 2016

Commons-logo.svg Wikimedia Commons has a file available for this logo.

Template documentation

Template commons file implements and formats inline links to file 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.

Full parameter set in horizontal format
{{commons file|[filename]|[appended text]|icon= |p= |term= }}

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

Parameter labels are in bold; explanatory/expanded text may follow in (parentheses).

Anonymous parameters

There are two ordered anonymous parameters; the target file page parameter ([1]) is required.
In order of usage:

  • [1] (filename): use the first anonymous parameter for the filename of an associated Wikimedia file page, which becomes the target filepage. Enter the file's name including its extension in plain textTemplate:Spaced en dashdo not enter the namespace "File:" or 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; see |p= below to link the original file.
  • [2] (postscript): use the second anonymous parameter to append optional explanatory text that displays after the target file page link.

Display parameters

All optional.

  • icon (logo): by default, the Wikimedia logo displays first, as a 15px icon (Commons-logo.svg); set |icon=n to suppress its display.
  • term (termination): by default, the template inserts a full stop as trailing (terminating) punctuation; use this parameter to replace or remove it.

Other parameters

  • p (project): by default, the file page link targets the Wikipedia copy; optionally, set |p=c to link the original Wikimedia Commons filepage.

Static text

The static text output by the template is quoted in the box below. For presentation purposes only, the link text to the target filepage is formatted as a non-linking example.

Template:Quote box

Examples

See also