Template:External media/doc: Difference between revisions

no edit summary
m (1 revision imported)
imported>Svetlov Artem
No edit summary
 
Line 7: Line 7:


# is currently available online,
# is currently available online,
# cannot be uploaded to Wikipedia, even under [[WP:NFCC|fair-use]] rules,  ''and''
# cannot be uploaded to Wikipedia, even under [[WP:NFCC|non-free use]] rules,  ''and''
# readers will expect this type of media in the article,
# readers will expect this type of media in the article,


Line 25: Line 25:
Paste this into your article, removing the parameters that are left blank:
Paste this into your article, removing the parameters that are left blank:


<pre><nowiki>
<syntaxhighlight lang="html">
{{external media
{{external media
| float  =
| float  =
Line 45: Line 45:
| model2 =
| model2 =
| model3 =
| model3 =
}}</nowiki></pre>
}}</syntaxhighlight>


The {{tl|external media}} template can be used multiple times in an article, and each instance can be used to link to more than one file.
The {{tl|external media}} template can be used multiple times in an article, and each instance can be used to link to more than one file.
Line 57: Line 57:
; headerimage: Optional image to display at the top of the template. Use full image syntax, for example <nowiki>[[File:example.png|200px]]</nowiki>.
; headerimage: Optional image to display at the top of the template. Use full image syntax, for example <nowiki>[[File:example.png|200px]]</nowiki>.
; caption: Optional caption text to put underneath the header image.
; caption: Optional caption text to put underneath the header image.
; media links: Each file to be linked should specify its type and have a different number, starting from 1. For example, a template containing four images and one video would label them as <code>image1</code>, <code>image2</code>, <code>image3</code>, <code>image4</code> and <code>video1</code>. The attribute has a free format, so any amount of detail may be added. The first part of the entry should be formatted as a normal external link, i.e. <code><nowiki>[http://example.com/image.jpg Image description]</nowiki></code> for [http://example.com/image.jpg Image description]. After that, any additional detail can be given on the same line. See the examples for details.<br />'''Note:''' when adding a link to an external media source like this, it is essential that the source page be linked too with the date of retrieval, both to satisfy Wikipedia's sourcing criteria for the statement about the presented media and to ensure that the link can quickly be corrected should the source URL be changed. Reference tags can be used for this purpose.
; media links: Each file to be linked should specify its type and have a different number, starting from 1. For example, a template containing four images and one video would label them as <code>image1</code>, <code>image2</code>, <code>image3</code>, <code>image4</code> and <code>video1</code>. The attribute has a free format, so any amount of detail may be added. The first part of the entry should be formatted as a normal external link, i.e. {{code|[http://example.com/image.jpg Image description]|moin}} for [http://example.com/image.jpg Image description]. After that, any additional detail can be given on the same line. See the examples for details.
: '''Note:''' when adding a link to an external media source like this, it is essential that the source page be linked too with the date of retrieval, both to satisfy Wikipedia's sourcing criteria for the statement about the presented media and to ensure that the link can quickly be corrected should the source URL be changed. Reference tags can be used for this purpose.
{{collapse top|header=TemplateData}}
<templatedata>
{
"params": {
"width": {
"description": "Width of the box",
"example": "300px, 22em, 30%",
"default": "258px"
},
"float": {
"type": "string",
"suggestedvalues": [
"left",
"right",
"center"
],
"description": "Alignment of the box on the page",
"suggested": true
},
"title": {
"description": "Optional text to replace the automatically calculated title"
},
"image1": {},
"audio1": {},
"video1": {},
"model1": {},
"image2": {},
"model2": {},
"topic": {
"description": "Optional text field that will appear above the media links"
},
"headerimage": {
"description": "Optional image to display at the top of the template. Use full image syntax, for example [[File:example.png|200px]].",
"type": "unbalanced-wikitext"
},
"caption": {
"description": "Optional caption text to put underneath the header image"
},
"image3": {},
"image4": {},
"image5": {},
"image6": {},
"image7": {},
"image8": {},
"image9": {},
"image10": {},
"image11": {},
"image12": {},
"image13": {},
"image14": {},
"image15": {},
"image16": {},
"image17": {},
"image18": {},
"image19": {},
"image20": {},
"audio2": {},
"audio3": {},
"audio4": {},
"audio5": {},
"audio6": {},
"audio7": {},
"audio8": {},
"audio9": {},
"audio10": {},
"audio11": {},
"audio12": {},
"audio13": {},
"audio14": {},
"audio15": {},
"audio16": {},
"audio17": {},
"audio18": {},
"audio19": {},
"audio20": {},
"video2": {},
"video3": {},
"video4": {},
"video5": {},
"video6": {},
"video7": {},
"video8": {},
"video9": {},
"video10": {},
"video11": {},
"video12": {},
"video13": {},
"video14": {},
"video15": {},
"video16": {},
"video17": {},
"video18": {},
"video19": {},
"video20": {},
"model3": {},
"model4": {},
"model5": {},
"model6": {},
"model7": {},
"model8": {},
"model9": {},
"model10": {},
"model11": {},
"model12": {},
"model13": {},
"model14": {},
"model15": {},
"model16": {},
"model17": {},
"model18": {},
"model19": {},
"model20": {}
},
"description": "Provides a box with a direct link to media hosted off of Wikipedia",
"paramOrder": [
"title",
"topic",
"caption",
"image1",
"audio1",
"video1",
"model1",
"width",
"float",
"headerimage",
"image2",
"model2",
"image3",
"image4",
"image5",
"image6",
"image7",
"image8",
"image9",
"image10",
"image11",
"image12",
"image13",
"image14",
"image15",
"image16",
"image17",
"image18",
"image19",
"image20",
"audio2",
"audio3",
"audio4",
"audio5",
"audio6",
"audio7",
"audio8",
"audio9",
"audio10",
"audio11",
"audio12",
"audio13",
"audio14",
"audio15",
"audio16",
"audio17",
"audio18",
"audio19",
"audio20",
"video2",
"video3",
"video4",
"video5",
"video6",
"video7",
"video8",
"video9",
"video10",
"video11",
"video12",
"video13",
"video14",
"video15",
"video16",
"video17",
"video18",
"video19",
"video20",
"model3",
"model4",
"model5",
"model6",
"model7",
"model8",
"model9",
"model10",
"model11",
"model12",
"model13",
"model14",
"model15",
"model16",
"model17",
"model18",
"model19",
"model20"
]
}
</templatedata>
{{collapse bottom}}


== Examples ==
== Examples ==
==== Just an image ====
==== Just an image ====
Image taken from the [[War against Nabis]] Featured Article. This example gives full contextual information along with references.
Image taken from the [[War against Nabis]] Featured Article. This example gives full contextual information along with references.


{{external media
{{external media
Line 68: Line 274:
}}
}}


<syntaxhighlight lang="xml" style="width:50%; overflow: auto">
<syntaxhighlight lang="xml" highlight="4" style="width:50%; overflow: auto">
{{external media
{{external media
| float = right
| float = right
Line 85: Line 291:
}}
}}


<syntaxhighlight lang="xml" style="width:50%; overflow: auto">
<syntaxhighlight lang="xml" highlight="4" style="width:50%; overflow: auto">
{{external media
{{external media
| float  = right
| float  = right
Line 105: Line 311:
}}
}}
{{clear}}
{{clear}}
<syntaxhighlight lang="xml" style="width:95%; overflow: auto">
<syntaxhighlight lang="xml" highlight="2,6,7" style="width:95%; overflow: auto">
{{external media
{{external media
| float  = left
| float  = left
Line 139: Line 345:
}}
}}


<syntaxhighlight lang="xml" style="width:50%; overflow: auto">
<syntaxhighlight lang="xml" highlight="3,4" style="width:50%; overflow: auto">
{{external media
{{external media
| width  = 210px
| width  = 210px
Line 151: Line 357:
{{external media
{{external media
| float  = right
| float  = right
| topic  = <code>¯\_(ツ)_/¯</code>
| caption = Two YouTube videos
| caption = Two YouTube videos
| headerimage= [[File:YouTube Logo 2017.svg|alt=YouTube logo|x20px|left]]
| headerimage= [[File:YouTube Logo 2017.svg|alt=YouTube logo|x20px|left]]
Line 158: Line 363:
}}
}}
{{clear}}  
{{clear}}  
<syntaxhighlight lang="moin" style="width95%; overflow: auto">
<syntaxhighlight lang="xml" highlight="2" style="width95%; overflow: auto">
{{external media
{{external media
| float  = right
| float  = right
| topic  = <code>¯\_(ツ)_/¯</code> <!--centered text--->
| caption = Two YouTube videos <!-- text placed left or right of headerimage --->
| caption = Two YouTube videos <!-- text placed left or right of headerimage --->
| headerimage= [[File:YouTube Logo 2017.svg|alt=YouTube logo|x20px|left]]
| headerimage= [[File:YouTube Logo 2017.svg|alt=YouTube logo|x20px|left]]