Template:Media/doc
This is a documentation subpage for Template:Media. It contains usage information, categories and other content that is not part of the original template page. |
This template uses Lua: |
This template is a typing aid that adds multimedia icons to any page. It is intended to identify which works have multimedia elements attached to them (such as audio files, spoken word versions, film clips and music). The template has two uses, both to create the icons and to provide a key for those icons.
Usage
[edit]{{Media | type = | multi = <!--The following only apply if "multi" is selected--> | audio = | music = | score = | video = <!--The following is only for use to create a key--> | key = | nobreak = | parts = | category = }}
If no parameters are set, the template will display the default "speaker" icon as used with audio files and spoken word versions of texts.
This template has two fuctions: Icon or Key.
Icon only
[edit]Icon only is the default setting of this template. Size can be adjusted (in pixels). Default size is 20px in the Author: namespace and 15px in the Main namespace. To adjust the size, use the number of pixels with no named parameter.
Multi can be used to display multiple icons. This overrides the type.
Key text
[edit]By setting the key parameter to yes, the template will display text to explain the icon. This will override the creation of icons. When using this fuction, the template should be placed in the appropriate page header.
The key will automatically include an opening line break, which is often but not always useful for displaying correctly. This line break can be deactivated by setting the nobreak parameter to yes.
The text of the key depends on the namespace combined with the type and parts parameters.
In the Author and Wikisource namespaces, this template inserts one of the following icons and text:
The icon indicates that the work includes a spoken word version.
The icon indicates that the work includes a musical version.
The icon indicates that the work is rendered with the Score extension.
The icon indicates that the work includes a video version.
In the main namespace (and any other namespace not mentioned), this template instead inserts one of the following icons and text:
one or more chapters are available in a spoken word format.
one or more pieces are available in a musical format.
one or more pieces are available in a format using the Score extension.
one or more parts are available in a video format.
The parts parameter can override the use of the word "chapters" in the text. This can be used in situations where the work is subdivided in a different manner. Possibilities include "parts" or "sections."
Note #1: When used as a key, this template adds Category:Spoken works (audio), Category:Works with music (music, score) or Category:Works with videos (video). To omit addition of the Category add the code {{Media| category = }}
Placement
[edit]Icon
[edit]On author pages, place the icon after the name of the text that has multimedia elements.
If a single chapter or other subsection of a work has multimedia elements, this template can be placed on the contents page of the work to indicate which contain the multimedia element(s). In these cases, place the icon after the name of the chapter or subsection (in this situation, the size should be 15px.)
Key
[edit]The key should be placed in the page header. This appropriate place depends on the namespace:
Namespace | Placement |
---|---|
Author | In the {{Author}} Description field |
Main | In the {{Header}} Notes field |
Wikisource | In the {{Process header}} Notes field |
Multimedia
[edit]This template displays icons for four types of media, as shown in this table. Any one of the keywords can be used with type to set the appropriate icon. To set more than one icon, set multi to "true" and set any of audio, music, score and video to "true" to display the icons.
Media type | Keyword(s) | Icon |
---|---|---|
Spoken word version (audiobook) | audio, spoken, speaker (default) | |
Music | music, song, note | |
Score | score | |
Video | video, film |
Speaker & Spoken
[edit]The previous version of this template was {{Speaker}}, which originally displayed only the speaker icon. {{Speaker}} is still in use and can still be used, as it redirects to this template.
The template {{Spoken}}, which originally provided a key for the speaker icon, has also been merged into this template. {{Spoken}} is still in use and can still be used, as it redirects to this template.
Examples
[edit]Basic icon examples
[edit]{{Media}}
{{Media|15}}
{{Media|type=music}}
{{Media|type=music|30}}
{{Media|type=film}}
{{Media|15|type=note}}
{{media|type = spoken}}
{{media|15|type = spoken}}
{{Speaker|type=film|15}}
Complicated icon examples
[edit]{{Media | multi = y | audio = | music = y | video = y }}
{{Media | multi = y | audio = y | video = y }}
{{Media | multi = y | audio = y | music = y | video = y | 15 }}
Key examples
[edit]{{Media|key=y}}
one or more chapters are available in a spoken word format.
{{Media | key = y | type = music }}
one or more pieces are available in a musical format.
{{Media | key = y | type = film }}
one or more parts are available in a video format.
{{Media|key=y|nobreak=y}}
one or more chapters are available in a spoken word format.
{{Media | key = y | parts = sections }}
one or more sections are available in a spoken word format.
Related templates
[edit]