Template:MyUploads

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Warning This template is currently broken
{{MyUploads/v-photostream|user=Sailko}}

{{MyUploads/grid-photostream|user=Sailko}}

{{MyUploads/h-photostream|user=Sailko}}

{{MyUploads/h-photostream-1|user=Sailko}}

Template documentationview · edit · history · purge ]
This documentation is transcluded from Template:MyUploads/doc.

Given some pattern-strings, the template will return an unordered list of the latest uploads. DISCLAIMER: This templates makes use of a dirty hack and may therefore break in future.

Usage

{{MyUploads |user= |limit= |offset= }}

Advanced Examples:

  • {{MyUploads|user=Rillke|limit=1|unstripPatternEach=1|patternWhole=%content%|patternEach={{:File<nowiki/>:%file%}}}} would print content of the file description page of the last uploaded file by the specified user.
  • {{MyUploads|user=Rillke|limit=1|unstripPatternEach=1|patternWhole=%content%|patternEach=[[File<nowiki/>:%file%|thumb|%file%, %size%, %time%]]}} shows the last uploaded file as thumbnail. See second example.

Template parameters

ParameterDescriptionDefaultStatus
user
name
User whose uploads to list.emptyoptional
limit
count
How many files to list.5optional
offsetTimestamp (Format currently YYYYMMDDhhmmss) to start listing reverse-chronological from. You may obtain this by going to Special:ListFiles and clicking back until you reach the point you want to start listing from.emptyoptional
patternWholeThe pattern for the "outer construct". '%content%' will be replaced with the content created by iterating over all files and filling the unstripPatternEach parameter<gallery mode="packed" widths="400">%content%\n</gallery>optional
unstripPatternWholeWhether to replace strip-markers (in case you want, simply include the parameter). There appears to be an issue; doing doesn't look successful. Strip markers (a character sequence starting and ending with a special character) are inserted by the MediaWiki parser and they replace, for example nowiki-tags so their content is not processed by the parser and, by default, also not by Lua.emptyoptional
patternEachThe pattern for the "inner construct" that will be used for each file. %file% will be replaced with the file's title (not including the namespace File:), %time% with the upload time (format may vary), %size% with the file size.\n%file%|File was uploaded on %time% and has a size of %size%optional
unstripPatternEachWhether to replace strip-markers (in case you want, simply include the parameter). Strip markers (a character sequence starting and ending with a special character) are inserted by the MediaWiki parser and they replace, for example nowiki-tags so their content is not processed by the parser and, by default, also not by Lua.emptyoptional
isGalleryBecause unstripping using unstripPatternWhole seems not to work, indicates that patternWhole is just a parameter-string inserted into a gallery-tag: The following example shows where patternWhole is inserted if this parameter is set: <gallery patternWhole></gallery>emptyoptional
Template data
<templatedata>JSON</templatedata> ./. {{TemplateBox}}
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.

Discussion
There is an ongoing discussion about that matter. Feel invited to comment if you are experienced in either way, your time permits and if you like to share your opinion or to make a suggestion.


Wikipedia's help about TemplateDataCommons-specific information

Given some pattern-strings, the template will return an unordered list of the latest uploads. DISCLAIMER: This templates makes use of a dirty hack and may therefore break in future.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
isGallery

Because unstripping using ''unstripPatternWhole'' seems not to work, indicates that patternWhole is just a parameter-string inserted into a gallery-tag: The following example shows where patternWhole is inserted if this parameter is set: <code>&lt;gallery patternWhole&gt;&lt;/gallery&gt;</code>

Numberoptional
limit count

How many files to list.

Default
5
Numberoptional
offset

Timestamp (Format currently YYYYMMDDhhmmss) to start listing reverse-chronological from. You may obtain this by going to [[Special:ListFiles]] and clicking back until you reach the point you want to start listing from.

Numberoptional
patternEach

The pattern for the "inner construct" that will be used for each file. ''%file%'' will be replaced with the file's title (not including the namespace ''File:''), ''%time%'' with the upload time (format may vary), ''%size%'' with the file size.

Default
<code>\n%file%|File was uploaded on %time% and has a size of %size%</code>
Stringoptional
patternWhole

The pattern for the "outer construct". '%content%' will be replaced with the content created by iterating over all files and filling the ''unstripPatternEach'' parameter

Default
<code>&lt;gallery mode="packed" widths="400"&gt;%content%\n&lt;/gallery&gt;</code>
Stringoptional
unstripPatternEach

Whether to replace strip-markers (in case you want, simply include the parameter). Strip markers (a character sequence starting and ending with a special character) are inserted by the MediaWiki parser and they replace, for example nowiki-tags so their content is not processed by the parser and, by default, also not by Lua.

Numberoptional
unstripPatternWhole

Whether to replace strip-markers (in case you want, simply include the parameter). There appears to be an issue; doing doesn't look successful. Strip markers (a character sequence starting and ending with a special character) are inserted by the MediaWiki parser and they replace, for example nowiki-tags so their content is not processed by the parser and, by default, also not by Lua.

Numberoptional
user name

User whose uploads to list.

Useroptional

Additional information

The template is intended to be used in the following namespaces: the User namespace

The template is intended to be used by the following user groups: all users

Relies on:

Example

{{MyUploads|user=Rillke|limit=10|offset=20120601111111}}

renders as:

Example 2

{{MyUploads
|user=Rillke
|limit=1
|unstripPatternEach=1
|patternWhole=%content%
|patternEach=[[File<nowiki/>:%file%|thumb|Rillke's latest upload: %file%, %size%, %time%]]
}}

Localization

This template is not intended to be localized.