Videos: Difference between revisions
From Dune Awakening DB
Created page with "{{#css:Template:VideoGallery/styles.css}} <div class="video-gallery-main-container"> <!-- Video Categories Section (60% width) --> <div class="video-categories"> <!-- Search Bar (Optional) --> <div class="video-search-bar"> <input type="text" class="video-search-input" placeholder="Search videos..."> <button class="video-search-button">Search</button> </div> <!-- Tab Navigation --> <div clas..." |
mNo edit summary |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
<includeonly><!-- Simple VideoGallery Template using External Data --> | |||
< | <div class="video-gallery-simple"> | ||
<h2>Video Gallery</h2> | |||
<!-- Get all videos from database --> | |||
{{#get_external_data: | |||
source = externaldb | |||
| from = data_videos | |||
| data = VideoID=video_id,YouTubeID=youtube_id,Title=video_title,Channel=channel_name,Duration=duration,Type=video_type,Tag=primary_tag,Description=description | |||
| cache = yes | |||
| where = visibility='public' | |||
| order by = publish_date DESC | |||
| limit = 20 | |||
}} | |||
<div class="video-grid-simple"> | |||
{{#for_external_table:| | |||
{{#vardefine:duration_min|{{#expr:{{{Duration}}} div 60}}}} | |||
{{#vardefine:duration_sec|{{#expr:{{{Duration}}} mod 60}}}} | |||
<div class="video-card-simple"> | |||
<a href="https://www.youtube.com/watch?v={{{YouTubeID}}}" target="_blank"> | |||
<img src="https://img.youtube.com/vi/{{{YouTubeID}}}/mqdefault.jpg" alt="{{{Title}}}"> | |||
<div class="video-duration">{{#var:duration_min}}:{{#ifexpr:{{#var:duration_sec}}<10|0|}}{{#var:duration_sec}}</div> | |||
</a> | |||
<h3>{{{Title}}}</h3> | |||
<p class="video-meta">{{{Channel}}} • {{{Tag}}}</p> | |||
</div> | |||
}} | |||
</div> | |||
< | |||
</div> | |||
</div> | </div> | ||
< | <style> | ||
.video-gallery-simple { padding: 20px; } | |||
{{# | .video-grid-simple { | ||
</ | display: grid; | ||
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); | |||
gap: 20px; | |||
} | |||
.video-card-simple { | |||
background: #f5f5f5; | |||
border-radius: 8px; | |||
overflow: hidden; | |||
} | |||
.video-card-simple a { | |||
position: relative; | |||
display: block; | |||
} | |||
.video-card-simple img { | |||
width: 100%; | |||
height: auto; | |||
} | |||
.video-duration { | |||
position: absolute; | |||
bottom: 8px; | |||
right: 8px; | |||
background: rgba(0,0,0,0.8); | |||
color: white; | |||
padding: 2px 6px; | |||
border-radius: 3px; | |||
font-size: 12px; | |||
} | |||
.video-card-simple h3 { | |||
padding: 10px; | |||
margin: 0; | |||
font-size: 16px; | |||
} | |||
.video-meta { | |||
padding: 0 10px 10px; | |||
margin: 0; | |||
color: #666; | |||
font-size: 14px; | |||
} | |||
</style> | |||
</includeonly><noinclude> | |||
{{Documentation}} | |||
< | == Simple Video Gallery Template == | ||
{{ | |||
This is a simplified version of the video gallery that just displays videos in a grid without tabs or advanced features. | |||
=== Usage === | |||
<pre> | |||
{{VideoGallerySimple}} | |||
</pre> | |||
=== Database Requirements === | |||
Requires the same `data_videos` table structure as the full video gallery. | |||
[[Category:Templates]] | |||
</noinclude> | |||
Latest revision as of 04:08, 2 June 2025
Simple Video Gallery Template
This is a simplified version of the video gallery that just displays videos in a grid without tabs or advanced features.
Usage
{{VideoGallerySimple}}
Database Requirements
Requires the same `data_videos` table structure as the full video gallery.
