![]() |
Progress Continues
We've already had 21664 updates since Dolphin 5.0. Keep up with Dolphin's continuing progress through the Dolphin Blog: February, March, and April 2024 Dolphin Progress Report. |
![]() |
The Dolphin Emulator Wiki needs your help! Dolphin can play thousands of games, and changes are happening all the time. Help us keep up! Join in and help us make this the best resource for Dolphin. |
Template:VideoGallery: Difference between revisions
Jump to navigation
Jump to search
(Try to label pages without videos) |
No edit summary |
||
Line 1: | Line 1: | ||
<includeonly>{{#vardefine:tl_vg_visible|true}}<div></div>{{#vardefine:tl_vg_videocount|1}}{{#vardefine:tl_vg_currentvideo|1}}{{#while:|{{{vid{{#var:tl_vg_videocount}}|}}}|{{#vardefine:tl_vg_videocount|{{#expr:{{#var:tl_vg_videocount}}+1}}}}}}{{#vardefine:tl_vg_videocount|{{#expr:{{#var:tl_vg_videocount}}-1}}}}{{#ifexpr:{{#var:tl_vg_videocount}}>50|{{#vardefine:tl_vg_videocount|50}}}}{{#ifexpr:{{#var:tl_vg_videocount}}<4|{{#while:|{{#ifexpr:{{#var:tl_vg_currentvideo}}<={{#var:tl_vg_videocount}}|true}}|{{{{{srv{{#var:tl_vg_currentvideo}}|YouTube}}}|{{{vid{{#var:tl_vg_currentvideo}}|}}}|{{{cap{{#var:tl_vg_currentvideo}}|}}}}}{{#vardefine:tl_vg_currentvideo|{{#expr:{{#var:tl_vg_currentvideo}}+1}}}}}}<br style="clear:left"/>|{{#vardefine:tl_vg_thumbnail1|{{#expr:{{rand|{{#var:tl_vg_videocount}}|1}}+1}}}}{{#vardefine:tl_vg_thumbnail2|{{#expr:{{rand|{{#var:tl_vg_videocount}}|2}}+1}}}}{{#vardefine:tl_vg_thumbnail3|{{#expr:{{rand|{{#var:tl_vg_videocount}}|3}}+1}}}}{{{{{srv{{#var:tl_vg_thumbnail1}}|YouTube}}}|{{{vid{{#var:tl_vg_thumbnail1}}|}}}|{{{cap{{#var:tl_vg_thumbnail1}}|}}}}}{{{{{srv{{#var:tl_vg_thumbnail2}}|YouTube}}}|{{{vid{{#var:tl_vg_thumbnail2}}|}}}|{{{cap{{#var:tl_vg_thumbnail2}}|}}}}}{{{{{srv{{#var:tl_vg_thumbnail3}}|YouTube}}}|{{{vid{{#var:tl_vg_thumbnail3}}|}}}|{{{cap{{#var:tl_vg_thumbnail3}}|}}}}}<div style="clear:left;"></div>{{#tag:ul|{{#while:|{{#ifexpr:{{#var:tl_vg_currentvideo}}<={{#var:tl_vg_videocount}}|true}}|{{#ifeq:{{#var:tl_vg_thumbnail1}}|{{#var:tl_vg_currentvideo}}||{{#ifeq:{{#var:tl_vg_thumbnail2}}|{{#var:tl_vg_currentvideo}}||{{#ifeq:{{#var:tl_vg_thumbnail3}}|{{#var:tl_vg_currentvideo}}||{{#tag:li|{{{{{srv{{#var:tl_vg_currentvideo}}|YouTube}}}|{{{vid{{#var:tl_vg_currentvideo}}|} | <includeonly>{{#vardefine:tl_vg_visible|true}}<div></div>{{#vardefine:tl_vg_videocount|1}}{{#vardefine:tl_vg_currentvideo|1}}{{#while:|{{{vid{{#var:tl_vg_videocount}}|}}}|{{#vardefine:tl_vg_videocount|{{#expr:{{#var:tl_vg_videocount}}+1}}}}}}{{#vardefine:tl_vg_videocount|{{#expr:{{#var:tl_vg_videocount}}-1}}}}{{#ifexpr:{{#var:tl_vg_videocount}}>50|{{#vardefine:tl_vg_videocount|50}}}}{{#ifexpr:{{#var:tl_vg_videocount}}<4|{{#while:|{{#ifexpr:{{#var:tl_vg_currentvideo}}<={{#var:tl_vg_videocount}}|true}}|{{{{{srv{{#var:tl_vg_currentvideo}}|YouTube}}}|{{{vid{{#var:tl_vg_currentvideo}}|}}}|{{{cap{{#var:tl_vg_currentvideo}}|}}}}}{{#vardefine:tl_vg_currentvideo|{{#expr:{{#var:tl_vg_currentvideo}}+1}}}}}}<br style="clear:left"/>|{{#vardefine:tl_vg_thumbnail1|{{#expr:{{rand|{{#var:tl_vg_videocount}}|1}}+1}}}}{{#vardefine:tl_vg_thumbnail2|{{#expr:{{rand|{{#var:tl_vg_videocount}}|2}}+1}}}}{{#vardefine:tl_vg_thumbnail3|{{#expr:{{rand|{{#var:tl_vg_videocount}}|3}}+1}}}}{{{{{srv{{#var:tl_vg_thumbnail1}}|YouTube}}}|{{{vid{{#var:tl_vg_thumbnail1}}|}}}|{{{cap{{#var:tl_vg_thumbnail1}}|}}}}}{{{{{srv{{#var:tl_vg_thumbnail2}}|YouTube}}}|{{{vid{{#var:tl_vg_thumbnail2}}|}}}|{{{cap{{#var:tl_vg_thumbnail2}}|}}}}}{{{{{srv{{#var:tl_vg_thumbnail3}}|YouTube}}}|{{{vid{{#var:tl_vg_thumbnail3}}|}}}|{{{cap{{#var:tl_vg_thumbnail3}}|}}}}}<div style="clear:left;"></div>{{#tag:ul|{{#while:|{{#ifexpr:{{#var:tl_vg_currentvideo}}<={{#var:tl_vg_videocount}}|true}}|{{#ifeq:{{#var:tl_vg_thumbnail1}}|{{#var:tl_vg_currentvideo}}||{{#ifeq:{{#var:tl_vg_thumbnail2}}|{{#var:tl_vg_currentvideo}}||{{#ifeq:{{#var:tl_vg_thumbnail3}}|{{#var:tl_vg_currentvideo}}||{{#tag:li|{{{{{srv{{#var:tl_vg_currentvideo}}|YouTube}}}|{{{vid{{#var:tl_vg_currentvideo}}|}}}|{{#tag:nowiki|{{{cap{{#var:tl_vg_currentvideo}}|}}}}}|link}}}}}}}}}}{{#vardefine:tl_vg_currentvideo|{{#expr:{{#var:tl_vg_currentvideo}}+1}}}}}}}}}}{{#ifeq:{{#var:vid1}}|""|[[Category:No video capture]]}}</includeonly><noinclude>{{documentation}}</noinclude> |
Revision as of 07:58, 3 July 2019
[edit] [ ] Template documentation
This template uses the embed video plugin to create a video gallery. If the page have more than 3 videos, this template will automatically randomly select 3 videos to show as thumbnails and the rest of the videos will be returned as plain text links.
Usage
The video gallery template should be called in the following way:
{{VideoGallery |vid1=<video ID>|cap1=<title> |vid2=<video ID>|cap2=<title> |vid3=<video ID>|cap3=<title> [...] |vidN=<video ID>|capN=<title> }}
where
Video ID
is the ID of the video that you are embedding (like the bold part in this URL: http://www.youtube.com/watch?v=VqNcksMfAjM).Title
(optional) is the caption for the video. If no caption is entered or if the parameter is omitted, the template will return the video URL as title.
Examples
Basic usage
- We have 2 videos and their corresponding IDs and title. So, every video ID and their corresponding title goes in one line:
{{VideoGallery |vid1=sam9lDWDvXE|cap1=Xenoblade JP HD Gameplay 1A (Dolphin Emulator @ 720p) |vid2=vKjjS8SRG9I|cap2=Xenoblade JP HD Gameplay 1B (Dolphin Emulator @ 720p) }}
- The above example produces this:
Behavior with multiple videos
- This time, we have 12 videos, so, the template will show only 3 random thumbnails and the other videos will be displayed as plain text links. Just add every video ID and their corresponding title in a separate line, like before:
{{VideoGallery |vid1=sam9lDWDvXE|cap1=Xenoblade JP HD Gameplay 1A (Dolphin Emulator @ 720p) |vid2=vKjjS8SRG9I|cap2=Xenoblade JP HD Gameplay 1B (Dolphin Emulator @ 720p) |vid3=f_0IbQrezTo|cap3=Xenoblade JP HD Gameplay 2 (Dolphin Emulator @ 720p) |vid4=_an7OMeK2nA|cap4=Xenoblade JP HD Gameplay 3 (Dolphin Emulator @ 720p) |vid5=wjzv0KtDXOA|cap5=Xenoblade JP HD Gameplay 4 (Dolphin Emulator @ 720p) |vid6=tJtCp8rPXWg|cap6=Xenoblade PAL HD Intro (Dolphin Emulator @ 1080p) |vid7=_VLNa9PKT0Y|cap7=Xenoblade PAL HD Gameplay 1 (Dolphin Emulator @ 720p) |vid8=dp3QnvFn_Hc|cap8=Xenoblade PAL HD Gameplay 2 (Dolphin Emulator @ 720p) |vid9=EzSDE3NOq_Y|cap9=Xenoblade PAL HD Gameplay 1 - Near start of game (Dolphin Emulator @ 720p) |vid10=oGcSdu3t8CQ|cap10=Xenoblade PAL HD Gameplay 2 - Continuation of Gameplay 1 (Dolphin Emulator @ 720p) |vid11=5Ywd5T5y91E|cap11=Xenoblade PAL HD - A protective mother (Dolphin Emulator @ 720p) |vid12=3Fvdc_LuWB4|cap12=Xenoblade Intro HD 1080p (Dolphin) }}
- The above example produces this:
- Xenoblade JP HD Gameplay 1A (Dolphin Emulator @ 720p)
- Xenoblade JP HD Gameplay 1B (Dolphin Emulator @ 720p)
- Xenoblade JP HD Gameplay 3 (Dolphin Emulator @ 720p)
- Xenoblade JP HD Gameplay 4 (Dolphin Emulator @ 720p)
- Xenoblade PAL HD Intro (Dolphin Emulator @ 1080p)
- Xenoblade PAL HD Gameplay 1 (Dolphin Emulator @ 720p)
- Xenoblade PAL HD Gameplay 1 - Near start of game (Dolphin Emulator @ 720p)
- Xenoblade PAL HD - A protective mother (Dolphin Emulator @ 720p)
- Xenoblade Intro HD 1080p (Dolphin)
Videos from different services
- This time, we have 2 videos from different services. The default is YouTube, for other services we need to add an additional
|srvN=
parameter (see notes for more details). Then, add every video ID, their corresponding title (and server) in a separate line, like before:
{{VideoGallery |vid1=sam9lDWDvXE|cap1=Xenoblade JP HD Gameplay 1A (Dolphin Emulator @ 720p) |srv2=dailymotion|vid2=x1ji36n_gremlins-gizmo-videogame-hd-on-dolphin-emulator_videogames|Gremlins game }}
- The above example produces this:
Notes
- If the template was called with more than 3 videos, every time that you access or refresh the page, you'll randomly get another 3 video thumbnails.
- The maximum number of videos that can be included with this template is limited to 50 (3 thumbnails + 47 links), if you include more than 50 videos, the template will ignore the additional videos and you'll probably get loop errors in the page.
- By default, this template accepts only videos from YouTube, however, you can include a
|srvN=
tag before|vidN=
entry to link videos from another service (videos from multiple services can be included in the same gallery). Specifying a service that aren't supported will just return a red link. The supported services and the corresponding parameter that should be used in|srvN=
are listed at EmbedVideo: Supported Services.
The above documentation is transcluded from Template:VideoGallery/doc. (edit | history) Editors can experiment in this template's sandbox (edit) and testcases (create) pages. Please add categories and interwikis to the /doc subpage. Subpages of this template. |