• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Listen/sandbox

  • Template
  • Talk
  • Language
  • Watch
  • Edit
< Template:Listen
This is the template sandbox page for Template:Listen (diff).
See also the companion subpage for test cases.
Template documentation[view] [edit] [history] [purge]
WarningThis template is used on approximately 16,000 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them.
For the inline audio template, see Template:Audio.
This template uses Lua:
  • Module:Listen (sandbox)

{{Listen}} allows audio and video files to be embedded in articles. It should be used for audio files that are set off from the text, such as music clips or sound recordings.

Contents

  • 1 Simple usage
    • 1.1 Multiple files
  • 2 Style parameters
  • 3 Examples
    • 3.1 Basic
    • 3.2 With video
    • 3.3 With header
    • 3.4 Embedding
    • 3.5 Plain
    • 3.6 Multiple files
  • 4 Microformat
  • 5 Tracking categories
  • 6 TemplateData
  • 7 See also

Simple usage

edit
{{Listen
| filename    =
| title       =
| description =
| pos         =
}}
  • filename (Required): the pagename of the media file, without the File: (formerly Image:) prefix
  • title (Required): the title of the audio file, to be displayed. Do not use wikilinks in the title – they will not work.
  • description: a description of the sounds being heard
  • pos: right (default), left, or center

Multiple files

edit

Additional files can be embedded in an article with one template by appending a number to each parameter.

{{Listen
| filename     =
| title        =
| alt          =
| description  =
| filename2    =
| title2       =
| alt2         =
| description2 =
| filename3    =
| title3       =
| alt3         =
| description3 =
}}
  • filename (Required): the pagename of the media file, without the File: (formerly Image:) prefix
  • title (Required): the title of the audio file, to be displayed.
  • alt: alt text for the image displayed for the file, for visually impaired readers; see Wikipedia:Alternative text for images. This is needed for file formats that include video as well as sound. The alt text should describe just the initial static image, not the entire video or its sound.
  • description: a description of the sounds being heard

Style parameters

edit

The template also takes a number of style parameters to control its appearance:

  • type: can be used to alter the image displayed at the left depending on the type of audio content being embedded. Acceptable values are music, speech and sound (default)
  • header: can be used to add a header to the box.
  • help: if set to |help=no, suppresses the help text that normally appears at the bottom of the box. Only do this if there are other audio files on the page which do have the help link; it must be provided on at least the first file on the article.
  • pos: by default the box floats to the right side of the screen. Setting this to left or center will float the box on the left-hand side, or center it, respectively.
  • image: define a different image. E.g. |image=[[File:Example.jpg|50px]]. You can set |image=none to disable the image entirely.
  • style: can be used to pass specific style instructions to the box. Setting this to float:none will anchor the box when this is convenient. Setting this to float:none; clear:none will enable the anchored box to co-exist gracefully beside another floating box.
  • play(n): some media files cannot be displayed inline; if this is the case set |play=no to prevent the broken inline link from displaying.
  • plain: if set |plain=yes, removes most of the ornamentation (table border, image, and help links) to give a minimalist version. This also removes the left/right float and positioning, to allow the box to be manually positioned as desired using the |style= (e.g., |style=float:right) parameter and surrounding markup.
  • embed: use |embed=yes to remove border and padding when using as a module embedded in another infobox (see examples below).
  • start(n): Timestamp at which the file should start playing
  • length(n): setting |length(n)=hide hides the duration (h:m:s).

Examples

edit

Basic

edit
Accordion chords
Chords being played on an accordion

Problems playing this file? See media help.
{{Listen
| filename    = Accordion chords-01.ogg
| title       = Accordion chords
| description = Chords being played on an accordion
}}

With video

edit
Inaugural address of Barack Obama (21:21)
Barack Obama's first inaugural address, January 20, 2009
(Duration: 21 minutes, 21 seconds)
{{Listen
| image       = [[File:Crystal Project video camera.png|50px]]
| help        = no
| filename    = Barack Obama inaugural address.ogv
| alt         = A black man in a black coat gestures and talks at a lecturn surrounded by teleprompters. Behind him, in the background, are about a dozen warmly-dressed onlookers.
| title       = Inaugural address of Barack Obama
| description = Barack Obama's [[First inauguration of Barack Obama|first inaugural address]], January 20, 2009<br />(Duration: 21 minutes, 21 seconds)
}}

With header

edit
Recordings of this phrase:
"One small step for a man..."
First words spoken on the Moon

Problems playing this file? See media help.
{{Listen
| header      = Recordings of this phrase:
| type        = speech
| filename    = Frase de Neil Armstrong.ogg
| title       = "One small step for a man..."
| description = First words spoken on the [[Moon]].
}}

Embedding

edit
See also: Template:Listen voice
Dr. Accordion
OccupationAccordion player
Accordion chords
{{Infobox person
| name = Dr. Accordion
| occupation = Accordion player
| module =
{{Listen
| filename = Accordion chords-01.ogg
| title    = Accordion chords
| embed    = yes
}}
}}

Plain

edit
{{Listen
| filename = Accordion chords-01.ogg
| title    = Accordion chords
| plain    = yes
| style    = float:left
}}
Accordion chords

Multiple files

edit
Accordion chords
Chords being played on an accordion

Moonlight Sonata
Beethoven's Sonata in C-sharp minor

Waltz No. 15
From Sixteen Waltzes, Op. 39 by Brahms

Problems playing these files? See media help.
{{Listen
| type         = music
| filename     = Accordion chords-01.ogg
| title        = Accordion chords
| description  = Chords being played on an accordion
| filename2    = Moonlight.ogg
| title2       = ''Moonlight Sonata''
| description2 = [[Ludwig van Beethoven|Beethoven]]'s [[Piano Sonata No. 14 (Beethoven)|Sonata in C-sharp minor]]
| filename3    = Brahms-waltz15.ogg
| title3       = Waltz No. 15
| description3 = From [[Sixteen Waltzes, Op. 39 (Brahms)|Sixteen Waltzes, Op. 39]] by [[Johannes Brahms|Brahms]]
}}

Microformat

edit
The HTML mark-up produced by this template includes an hAudio microformat that makes an audio recording's details readily parsable by computer programs. This aids tasks such as the cataloguing of articles and maintenance of databases. For more information about the use of microformats on Wikipedia, please visit the Microformat WikiProject.
Subtemplates

Date-of-publication ("published") information will only be included in the microformat if {{start date}} (or, where appropriate, {{start date and age}}) is used in a parent infobox/template. Do not, however, use {{start date}} or {{start date and age}} if a date before 1583 CE is involved.

Use {{duration}} to specify the duration/length of a recording. For instance, if the recording's duration is 3 minutes 45 seconds, use {{duration|m=3|s=45}} (which appears as: 3:45). If needed, |h= may be included to specify a number of hours.

Please do not remove instances of these subtemplates.

Classes used

The HTML classes of this microformat include:

  • haudio
  • fn
  • album
  • description
  • category
  • contributor
  • duration
  • h
  • item
  • min
  • photo
  • position
  • price
  • published
  • s
Please do not rename or remove these classes
nor collapse nested elements which use them.

Tracking categories

edit
  • Category:Articles with hAudio microformats (243,512)
  • Category:Articles with empty listen template (387)
  • Category:Listen template using plain parameter (201)

TemplateData

edit
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Listen in articles based on its TemplateData.

TemplateData for Listen

Allows audio and video files to be embedded in articles.

Template parameters[Edit template data]

This template has custom formatting.

ParameterDescriptionTypeStatus
Headerheader

Text or other content to go above all the files in the template (but within the template boundary). Allows markup.

Contentoptional
Music or speech icontype

Enter "music" or "speech" here to change the template icon to a speaker with music notes or a microphone.

Suggested values
sound music speech
Default
sound
Example
music
Lineoptional
Custom iconimage

Custom image to replace the speaker icon in the template. Alternatively, enter "none" here to hide the icon entirely.

Example
[[File:Example.jpg|50px]], none
Fileoptional
Filenamefilename

The filename of the file. Filename2, filename3, etc. can be used for subsequent files.

Filerequired
Titletitle

The title to display for the file. Title2, title3, etc. can be used for subsequent files.

Stringrequired
Descriptiondescription

A description of the file. Description2, description3, etc. can be used for subsequent files.

Stringsuggested
Start timestart

Timestamp at which the first file should start playing (start2, start3, etc. can be used for subsequent files)

Example
0:20
Lineoptional
Hide duration?length

Enter "hide" here to hide the duration of the first file (length2, length3, etc. can be used for subsequent files).

Example
hide
Lineoptional
Hide player?play

Enter "no" here to hide the file player for the first file (play2, play3, etc. can be used for subsequent files). To be used for some media files that cannot be displayed inline, to prevent a broken inline link from showing.

Example
no
Lineoptional
Hide help text?help

Enter "no" here to hide the "Problems playing this file? See media help." text at the bottom of the template. Must not be done on the first instance of the template; optional on subsequent instances of the template.

Example
no
Lineoptional
Positionpos

Enter "left" or "center" here to change the default position of the template from on the right.

Suggested values
left center right
Default
right
Example
left
Lineoptional
Plain style?plain

Enter "yes" here to remove most of the ornamentation (border, background, icon and help text) and the float/positioning of the template to give a minimalist version, allowing the user to use the custom CSS ("style") parameter to style and position the template.

Example
yes
Lineoptional
Optimise for embedding?embed

Enter any text here to remove the left, right and bottom border, the background, the icon, the help text and the padding of the template for use in an infobox.

Example
y
Lineoptional
Custom CSSstyle

Custom CSS for the template

Example
float:none; clear:none
Contentoptional

See also

edit
  • view
  • talk
  • edit
  • {{Listen}} – sets an audio clip off from the main text
    • {{Listen image}} – sets an audio clip and an associated image off from the main text
  • {{Audio}} – for inline sounds like pronunciations
    • {{Audio-IPA}} – a variant of this template to be used with IPA notation
    • {{Pronunciation}} – a shortcut for {{small|{{Audio|soundfile.ogg|pronunciation}}}}
  • {{Spoken Wikipedia}} – for linking spoken Wikipedia article versions
  • {{Audio icon}} – adds only the small icon with no links
  • {{Inline audio}} – adds a notice with link to Wikipedia:Media help
  • v
  • t
  • e
Film- and television-related infobox templates
Film
  • Film
    • /short description
  • Film or theatre festival
  • Art movement
  • Cinema market
  • Movie quote
Television
  • Television
    • /Short description
  • Television season
    • Reality competition season
  • Television episode
    • crossover
      • /part
    • Doctor Who
    • Futurama
    • Simpsons
  • Animanga
Misc video
  • Paris by Night
  • Machinima
Industry
  • Award
  • Awards list
  • Film awards
    • /link
    • /style
  • Broadcasting network
  • Television channel
  • Television station
  • Programming block
  • Presenter
Technical
  • Camera
  • Movie camera
  • Camera mount
  • Photographic lens
  • Lens design
  • Photographic film
Fiction
  • Artifact
  • Character
    • Doctor Who doctor
    • G.I. Joe
    • Soap opera
  • Family
    • Family member
  • Location
  • Organisation
  • Race
  • Vehicle
Template modules
  • Name module
  • Based on
  • Person
  • Listen
Related
  • Advertising
  • Media franchise
  • Audio drama
  • Podcast
  • Radio station
  • Radio show
The above documentation is transcluded from Template:Listen/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Listen/sandbox&oldid=847057590"
Last edited on 22 June 2018, at 16:40

Languages

      This page is not available in other languages.

      Wikipedia
      • Wikimedia Foundation
      • Powered by MediaWiki
      • This page was last edited on 22 June 2018, at 16:40 (UTC).
      • Content is available under CC BY-SA 4.0 unless otherwise noted.
      • Privacy policy
      • About Wikipedia
      • Disclaimers
      • Contact Wikipedia
      • Code of Conduct
      • Developers
      • Statistics
      • Cookie statement
      • Terms of Use
      • Desktop