Template:YouTube: Difference between revisions

From LudoWiki
No edit summary
No edit summary
 
(36 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><div style="float:{{{3|left}}};">{{#widget:YouTube|id={{{1}}}|width={{#switch:{{{2}}}|small=356|medium=560|big=640|large=853|480}}|height={{#switch:{{{2}}}|small=200|medium=340|big=385|large=505|295}} }}</div>{{#if: {{{4|}}} | | <br style="clear:{{{3|left}}};" /> }} <span style="display:none;">[[Video::Video:{{{1}}}]]</span> [[Category:Pages with YouTube videos]]</includeonly>
<includeonly><div style="float:{{{3|left}}};" itemprop="video" itemtype="https://schema.org/VideoObject" itemscope>
{{#widget:YouTube|id={{{1}}}|width={{#switch:{{{2}}}|small=356|medium=560|big=640|large=854|100%}}}}
{{#get_web_data:url=https://youtube.googleapis.com/youtube/v3/videos?part=snippet%2CcontentDetails%2Cstatistics&id={{{1}}}&key=AIzaSyC-zQp-SoOYbKh64GrNhBK5D3g7H9oX7Zs|format=json}}
<!-- mandatory properties for google rich snippets -->
<meta itemprop="name" content="{{#ask: [[Category:YouTube videos]] [[YouTube video ID::{{{1}}}]] |link=none |default={{#external_value:title}} }}"/>
<meta itemprop="description" content="{{#ask: [[Category:YouTube videos]] [[YouTube video ID::{{{1}}}]] |link=none |default={{#external_value:title}} }} on YouTube." />
<meta itemprop="thumbnailUrl" content="https://i.ytimg.com/vi/{{{1}}}/maxresdefault.jpg" />
<meta itemprop="uploadDate" content="{{#external_value:publishedat}}" />
<meta itemprop="embedUrl" content="https://www.youtube.com/embed/{{{1}}}?controls=2&modestbranding=1&rel=0" />
<!-- non-mandatory properties for google rich snippets -->
<meta itemprop="duration" content="{{#external_value:duration}}" />
</div>{{#if: {{{4|}}} | | <br style="clear:{{{3|left}}};" /> }}{{#ifeq:
{{#ask: [[Category:YouTube videos]] [[YouTube video ID::{{{1}}}]]
|?YouTube video ID=
| headers=hide
| mainlabel=-
| default=none
}}
| {{{1}}}
| Click for more info: {{#ask: [[YouTube video ID::{{{1}}}]]}}
| {{#formlink:form=YouTube_video_page|link text=Create wiki page for this video|YouTube data display[YouTube video ID]={{{1}}}}}
}}[[Category:Pages with YouTube videos]]</includeonly>

Latest revision as of 11:57, 15 February 2023