Bruger:PHansen/Listen
Udseende
Vedrører forespørgsel
Wikipedia:Landsbybrønden#Flere musikeksempler i samme boks?
- This template is a meta-template that can be used to create nicely-styled floating content boxes.
- It is used to insert an empty, 1px wide, table cell into an HTML table or wikitable. It can be used whenever an empty cell is required to balance a table, for instance when hardcoding mbox templates.
- 2a. Bruger:PHansen/Listen/core - en:Template:Listen/core - wikidata:Q11838725 - Kategori:Lydskabeloner - en:Category:Articles with empty listen template
- Kode
{{side box |position = {{{pos|}}} |style = {{#ifeq:{{{plain|}}}|yes|border:none; background:transparent; float:none;}}{{#ifeq:{{{pos|}}}|left|float:left;}}{{{style|}}} |textstyle = line-height:1.1em; |image = {{#ifeq:{{{plain|}}}|yes||{{#if:{{{image|}}}|{{{image}}}|[[Image:{{#switch:{{lc:{{{type|}}}}} | sound = Gnome-mime-sound-openclipart.svg | speech = Audio-input-microphone.svg | music= Gnome-mime-audio-openclipart.svg | #default = Gnome-mime-sound-openclipart.svg }}|65x50px|center|link=|alt=]]}}}} |text = {{#if:{{{header|}}}|<div style="background:transparent; text-align:left; padding:2px;">{{{header}}}</div>}} {{listen/core |filename = {{{filename|}}} |title = {{{title|}}} |description = {{{description|}}} |alt = {{{alt|}}} |play = {{{play|}}} }} {{#if:{{{filename2|}}}| {{listen/core |filename = {{{filename2|}}} |title = {{{title2|}}} |description = {{{description2|}}} |alt = {{{alt2|}}} |play = {{{play2|}}} }}}}{{#if:{{{filename3|}}}| {{listen/core |filename = {{{filename3|}}} |title = {{{title3|}}} |description = {{{description3|}}} |alt = {{{alt3|}}} |play = {{{play3|}}} }}}}{{#if:{{{filename4|}}}| {{listen/core |filename = {{{filename4|}}} |title = {{{title4|}}} |description = {{{description4|}}} |alt = {{{alt4|}}} |play = {{{play4|}}} }}}}{{#if:{{{filename5|}}}| {{listen/core |filename = {{{filename5|}}} |title = {{{title5|}}} |description = {{{description5|}}} |alt = {{{alt5|}}} |play = {{{play5|}}} }}}}{{#if:{{{filename6|}}}| {{listen/core |filename = {{{filename6|}}} |title = {{{title6|}}} |description = {{{description6|}}} |alt = {{{alt6|}}} |play = {{{play6|}}} }}}}{{#if:{{{filename7|}}}| {{listen/core |filename = {{{filename7|}}} |title = {{{title7|}}} |description = {{{description7|}}} |alt = {{{alt7|}}} |play = {{{play7|}}} }}}}{{#if:{{{filename8|}}}| {{listen/core |filename = {{{filename8|}}} |title = {{{title8|}}} |description = {{{description8|}}} |alt = {{{alt8|}}} |play = {{{play8|}}} }}}}{{#if:{{{filename9|}}}| {{listen/core |filename = {{{filename9|}}} |title = {{{title9|}}} |description = {{{description9|}}} |alt = {{{alt9|}}} |play = {{{play9|}}} }}}}{{#if:{{{filename10|}}}| {{listen/core |filename = {{{filename10|}}} |title = {{{title10|}}} |description = {{{description10|}}} |alt = {{{alt10|}}} |play = {{{play10|}}} }}}} |below = {{#ifeq:{{{plain|}}}|yes||{{#ifeq:{{{help|}}}|no||<span style="font-size:smaller;">''Problems listening to {{#if:{{{filename2|}}}{{{filename3|}}}{{{filename4|}}}{{{filename5|}}}{{{filename6|}}}{{{filename7|}}}{{{filename8|}}}{{{filename9|}}}{{{filename10|}}}|these files|this file}}? See [[Wikipedia:Media help|media help]].''</span>}}}} }}{{#ifeq:{{NAMESPACE}}|{{ns:0}}|[[:Category:Articles with hAudio microformats]]}}<noinclude>{ {documentation}}</noinclude>
[[:File:|]]
[[File:|220px|noicon|alt=]]
|
|
Problems listening to this file? See Hjælp:Ogg Vorbis eller media help. |
{ {documentation subpage}}
{{PHansen/Listen}} allows audio files to be embedded in articles. It should be used for audio files that are set off from the text, like music clips or sound recordings.
Simple usage
[redigér | rediger kildetekst]{{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 quote marks around song titles. Do not use wikilinks in the title – they will not work.
- description: a description of the audio file
- pos = left or right
Multiple files
[redigér | rediger kildetekst]Additional files can be embedded in an article with one template by appending a number to each parameter. Up to ten files can be included.
{{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. Do not use quote marks around song titles.
- 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 such as Ogg's
.ogv
format 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 audio file
Style parameters
[redigér | rediger kildetekst]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
|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 will cause the box to instead float on the left-hand side.
- image: define a different image. Eg
|image=[[File:Example.jps|20px]]
. 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#: 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.
Examples
[redigér | rediger kildetekst]- Basic example
|
|
Problems listening to this file? See Hjælp:Ogg Vorbis eller media help. |
{{Listen | filename = Accordion chords-01.ogg | title = Accordion chords | description = Chords being played on an accordion }}
- Example with video
Inaugural Address
Barack Obama delivers his inaugural address on January 20, 2009.
(Duration: 21 minutes, 21 seconds) |
{{Listen | header = Inaugural Address | 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 delivers his [[inaugural address]] on January 20, 2009.<br>(Duration: 21 minutes, 21 seconds) | help = no | type = sound }}
- Example with header
Recordings of this phrase:
|
|
Problems listening to this file? See Hjælp:Ogg Vorbis eller media help. |
{{Listen | filename = Phrase de Neil Armstrong.oga | title = "One small step for a man..." | description = First words spoken on the [[moon]]. | type = speech | pos = left | header = Recordings of this phrase: }}
- Plain example
|
{{Listen | filename = Accordion chords-01.ogg | title = Accordion chords | plain = yes | style = float:left }}
- Multiple files
The traditional French children's song
|
|
Problems listening to these files? See Hjælp:Ogg Vorbis eller media help. |
{{Listen | filename = Accordion chords-01.ogg | title = Accordion chords | description = Chords being played on an accordion | type = music | filename2 = Moonlight.ogg | title2 = ''Moonlight Sonata'' | description2 = [[Beethoven]]'s "Sonata in C-sharp minor" | filename3 = Au_clair_de_la_lune_mode_do.mid | title3 = Au Clair de la Lune | description3 = The traditional French children's song | play3 = no }}
Microformat
[redigér | rediger kildetekst]- {{UF-audio}}
See also
[redigér | rediger kildetekst]- {{Audio}}, a variant of this template meant more for inline sounds like pronunciations.
- {{Multi-listen start}}, {{Multi-listen item}}, and {{Multi-listen end}}, templates used to list multiple audio files in the same box
- {{Listen MIDI}}, for MIDI files.
<includeonly>
</includeonly>