Difference between revisions of "Template:Video"

From Appropedia
Jump to navigation Jump to search
m (Text replacement - "Has author" to "Author")
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<div class="video">{{#if:{{{url|{{{1|{{{video|}}}}}}}}}
+
<div class="video">{{#if:{{{1|{{{video|}}}}}}
|{{#ifexist:Media:{{{url|{{{1|{{{video|}}}}}}}}}
+
|{{#ifexist:Media:{{{1|{{{video|}}}}}}
  |[[File:{{{url|{{{1|{{{video|}}}}}}}}}|640px]]
+
  |[[File:{{{1|{{{video|}}}}}}|640px]]
  |{{#evt:service={{lc:{{Video/service|{{{url|{{{1|{{{video|}}}}}}}}}}}}}|id={{Video/id|{{{url|{{{1|{{{video|}}}}}}}}}}}|urlargs=enablejsapi=1}}
+
  |{{#evt:service={{lc:{{Video/service|{{{1|{{{video|}}}}}}}}}}|id={{Video/id|{{{1|{{{video|}}}}}}}}|urlargs=enablejsapi=1&rel=0}}
 
  }}
 
  }}
 
|[[File:Placeholder.mp4|640px]]
 
|[[File:Placeholder.mp4|640px]]
}}</div><templatestyles src="Video/styles.css" />{{#if:{{{video|}}}|{{#subobject:
+
}}{{#if:{{{2|{{{title|}}}}}}{{{description|}}}{{{authors|}}}{{{date|}}}{{{location|}}}{{{annotations|}}}|<div class="video-data">{{#if:{{{2|{{{title|}}}}}}|
 +
<div class="video-title">{{{2|{{{title|}}}}}}</div>}}{{#if:{{{description|}}}|
 +
<div class="video-description">{{{description}}}</div>}}{{#if:{{{keywords|}}}|
 +
<div class="video-keywords">Keywords: {{#arraymap:{{{keywords|}}}|,|@|{{Property|Has keyword|{{lc:@}}}}}}</div>}}{{#if:{{{authors|}}}|
 +
<div class="video-authors">By {{#arraymap:{{{authors|}}}|,|@|{{#ifexist:@|[[@|{{#if:{{#show:@|?Has name}}|{{#show:@|?Has name}}|{{#if:{{REALNAME:@}}|{{REALNAME:@}}|{{PAGENAME:@}}}}}}]]|@}}}}</div>}}{{#if:{{{date|}}}|
 +
<div class="video-date">{{{date}}}</div>}}{{#if:{{{location|}}}|
 +
<div class="video-location">{{#arraymap:{{{location}}}|,|@|[[@]]}}</div>}}{{#if:{{{license|}}}|
 +
<div class="video-license">License: {{{license}}}</div>}}{{#if:{{{annotations|}}}|
 +
<div class="video-annotations">
 +
Annotations {{#info: Click on a timestamp to navigate through the video }}
 +
{{{annotations}}}</div>}}
 +
</div>}}</div><templatestyles src="Video/styles.css" />{{#if:{{{1|{{{video|}}}}}}|{{#subobject:
 
|Has title = {{#if:{{{2|{{{title|}}}}}}|{{{2|{{{title}}}}}}|{{PAGENAME}}}}
 
|Has title = {{#if:{{{2|{{{title|}}}}}}|{{{2|{{{title}}}}}}|{{PAGENAME}}}}
|Has image URL = {{#switch:{{Video/service|{{{url|{{{1|{{{video|}}}}}}}}}}}
+
|Has image URL = {{#switch:{{Video/service|{{{1|{{{video|}}}}}}}}
  |YouTube = https://img.youtube.com/vi/{{Video/id|{{{url|{{{1|{{{video|}}}}}}}}}}}/0.jpg
+
  |YouTube = https://img.youtube.com/vi/{{Video/id|{{{1|{{{video|}}}}}}}}/0.jpg
  |Vimeo = https://i.vimeocdn.com/video/{{Video/id|{{{url|{{{1|{{{video|}}}}}}}}}}}_200.jpg
+
  |Vimeo = https://i.vimeocdn.com/video/{{Video/id|{{{1|{{{video|}}}}}}}}_200.jpg
 
  }}
 
  }}
|Has URL = {{Video/url|{{Video/service|{{{url|{{{1|{{{video|}}}}}}}}}}}|{{Video/id|{{{url|{{{1|{{{video|}}}}}}}}}}}}}
+
|Has URL = {{Video/url|{{Video/service|{{{1|{{{video|}}}}}}}}|{{Video/id|{{{1|{{{video|}}}}}}}}}}
|Has platform = {{Video/service|{{{url|{{{1|{{{video|}}}}}}}}}}}
+
|Has platform = {{Video/service|{{{1|{{{video|}}}}}}}}
 
|Has description = {{{description|}}}
 
|Has description = {{{description|}}}
|Has language = {{{language|English}}}
+
|Has keyword = {{{keywords|}}}|+sep
 +
|Author = {{{authors|}}}|+sep
 +
|Has date of publication = {{{date|}}}
 +
|Has license = {{{license|}}}
 +
|Language = {{{language|English}}}
 +
|Location = {{{location|}}}
 
|Type = Video
 
|Type = Video
 
}}{{#if:{{NAMESPACE}}||[[Category:Pages with videos]]}}}}<noinclude>{{Documentation}}</noinclude>
 
}}{{#if:{{NAMESPACE}}||[[Category:Pages with videos]]}}}}<noinclude>{{Documentation}}</noinclude>

Latest revision as of 00:10, 25 January 2021

Template documentation[edit]

Use this template to embed videos uploaded to Appropedia, Wikimedia Commons, YouTube or Vimeo, associate meta data to them in order to make them searchable, and put them into Category:Pages with videos.

Usage[edit source]

Basic[edit source]

  • {{Video|video=Placeholder.mp4}} − Embed a video uploaded to Appropedia
  • {{Video|video=The Yakan Native Dance.webm}} − Embed a video uploaded to Wikimedia Commons
  • {{Video|video=hkFqpkV3fF4}} − Embed a YouTube video by id
  • {{Video|video=https://www.youtube.com/watch?v=hkFqpkV3fF4}} − Embed a YouTube video by URL

Parameters[edit source]

  • videoRequired File name, id or URL, for example https://www.youtube.com/watch?v=hkFqpkV3fF4, https://vimeo.com/431803145 or simply 'hkFqpkV3fF4' or 431803145
  • title − Title of the video, used for search results.
  • description − Description of the video content, used for search results.
  • keywords − Comma-separated list of keywords, for example "solar, garden, recycle".
  • authors − Authors names or usernames on Appropedia (including the 'User:' prefix).
  • date − Date when the video was made, for example '2020-09-23'.
  • location − Location where the video was made, for example 'Buenos Aires, Argentina'.
  • language − Language of the video, for example 'Spanish'. English is assumed.
  • license − License under which this video is released, for example "CC-BY-SA 4.0".

Example[edit source]

{{Video
|video = House wren in JBWR (50171).webm
|title = House wren in JBWR
|description = House wren guards its nest
|keywords = bird, wren, nest
|authors = Rhododendrites
|date = 2020-07-05
|location = Jamaica
|language = English
|license = CC BY 4.0
}}
House wren in JBWR
House wren guards its nest
Keywords: bird, wren, nest
By Rhododendrites
2020-07-05
License: CC BY 4.0

See also[edit source]

Template data[edit source]

Embed videos uploaded to Appropedia, Wikimedia Commons, YouTube or Vimeo.

Template parameters

ParameterDescriptionTypeStatus
Videovideo 1

Video name, URL or id

Example
Example.mp4, https://www.youtube.com/watch?v=3R2gvgcdseI or 3R2gvgcdseI
Stringrequired
Titletitle 2

Video title

Example
How to build an igloo
Stringoptional
Descriptiondescription

Video description

Stringoptional
Keywordskeywords

Comma-separated list of keywords

Example
solar, garden, recycle
Stringoptional
Authorsauthors

Authors names or usernames on Appropedia (including the 'User:' prefix)

Example
Lonny, Emilio, John Doe
Stringoptional
Datedate

Date when the video was made

Example
2020-09-23
Dateoptional
Locationlocation

Location where the video was made

Example
Buenos Aires, Argentina
Stringoptional
Languagelanguage

Video language

Default
English
Example
Spanish
Stringoptional
Licencelicense

License under which this video is released

Example
CC-BY-SA 4.0
Stringoptional
Annotationsannotations

no description

Stringoptional