Difference between revisions of "Template:IPA audio link"

From blackwiki
Jump to navigation Jump to search
imported>Kaldari
(add support for "attribution=no" per talk page)
imported>Kaldari
(No need for extra whitespace after icon by itself, nor extra span)
 
Line 1: Line 1:
&#32;<span class="nowrap" style="font-size:85%">{{#ifeq:{{{attribution|}}}|no|<includeonly>{{#if:{{{1|}}}|{{#ifexist:Media:{{{1}}}|<span class="unicode haudio"><span class="fn"><span style="white-space:nowrap;margin-right:.25em;">[[File:Loudspeaker.svg|11px|link=Special:Filepath/{{{1}}}|Listen]]</span></span>{{main other|[[Category:Articles with hAudio microformats]]}}</span>|{{error{{main other||-small}}|Audio file "{{{1}}}" not found}}<!-- tracking category begin -->{{Category handler|[[Category:Pages linking to missing files]]}}<!-- tracking category end -->}}}}</includeonly>|({{Audio|{{{1|}}}|listen|help=no}})}}</span><noinclude>
+
&#32;<span class="nowrap" style="font-size:85%">{{#ifeq:{{{attribution|}}}|no|<includeonly>{{#if:{{{1|}}}|{{#ifexist:Media:{{{1}}}|<span class="unicode haudio"><span class="fn">[[File:Loudspeaker.svg|11px|link=Special:Filepath/{{{1}}}|Listen]]</span>{{main other|[[Category:Articles with hAudio microformats]]}}</span>|{{error{{main other||-small}}|Audio file "{{{1}}}" not found}}<!-- tracking category begin -->{{Category handler|[[Category:Pages linking to missing files]]}}<!-- tracking category end -->}}}}</includeonly>|({{Audio|{{{1|}}}|listen|help=no}})}}</span><noinclude>
 
{{documentation}}
 
{{documentation}}
 
</noinclude>
 
</noinclude>

Latest revision as of 21:33, 29 October 2020

()

Template documentation[view] [edit] [history] [purge]

This template formats the audio link used by Template:IPA-all and similar templates at Category:IPA templates. It should not be used directly in articles.

Usage

Usage within an IPA template will typically be something similar to:
{{#if:{{{3|}}}|{{IPA audio link|{{{3}}}|attribution={{{attribution|}}} }} }}

In the sample code above, "3" is the parameter for the file name (e.g. "Fr-Avignon.ogg") and "attribution" is an optional parameter specifying whether or not to create an attribution link (i.e. a link to the file page).

Example output

Note that this template is not intended for use directly in articles. The following examples are purely to show variations in output.

Basic
  • [aviɲɔ̃] (About this soundlisten)
    [aviɲɔ̃]{{IPA audio link|Fr-Avignon.ogg}}
Without attribution link

Audio files which are licensed as CC0 or public domain may be linked to without an attribution link:

  • [aviɲɔ̃] Listen
    [aviɲɔ̃]{{IPA audio link|Fr-Avignon.ogg|attribution=no}}

TemplateData

Formats the audio link used by IPA-all and similar templates

Template parameters

ParameterDescriptionTypeStatus
Audio file1

The audio file without the "File:" prefix

Example
En-us-Foobar.ogg
Unknownoptional
Attribution linkattribution

Set attribution to "no" to only display a speaker icon that links directly to the audio file (with no link to the File page).

Example
no
Unknownoptional