« Modèle:Audio » : différence entre les versions
m (1 révision importée) |
Aucun résumé des modifications |
||
Ligne 15 : | Ligne 15 : | ||
<pre> | <pre> | ||
{{Audio | {{Audio | ||
|name= | |name=Ventfrais.mp3 | ||
}} | }} | ||
</pre> | </pre> | ||
Ligne 27 : | Ligne 27 : | ||
=== locally hosted file === | === locally hosted file === | ||
{{Audio | {{Audio | ||
|name= | |name=Ventfrais.mp3 | ||
}} | }} | ||
Dernière version du 13 mars 2020 à 12:10
Description
This is the Audio template. It uses the Html5mediaAudio widget but helps to avoid adding the full URL of a locally uploaded file to the widget's "url
" parameter by rather just specifying the name of the file via the "name
" parameter. It is however still possible to use the "url
" parameter for an externally hosted file.
Usage
externally hosted file
{{Audio |url=https://upload.wikimedia.org/wikipedia/commons/5/5c/Wagner_Tristan_opening_(orchestral).ogg }}
locally hosted file
{{Audio |name=Ventfrais.mp3 }}
Example
externally hosted file
locally hosted file
Code
Just copy the following code to a page called "Template:Audio" on your wiki.
<includeonly>{{#widget:Html5mediaAudio |url={{#if: {{{url|}}} |{{{url|}}} |{{filepath: {{{name|}}} }} }} }}</includeonly>