Add poster field to video artwork blueprints
This commit is contained in:
parent
c0e9465298
commit
f4d9653fe6
3 changed files with 30 additions and 6 deletions
|
@ -9,6 +9,24 @@ fields:
|
||||||
en: Alternative text
|
en: Alternative text
|
||||||
fr: Texte alternatif
|
fr: Texte alternatif
|
||||||
type: text
|
type: text
|
||||||
|
poster:
|
||||||
|
when:
|
||||||
|
file_type: video
|
||||||
|
label:
|
||||||
|
en: Poster
|
||||||
|
fr: Vignette
|
||||||
|
type: files
|
||||||
|
uploads: image
|
||||||
|
layout: cards
|
||||||
|
image:
|
||||||
|
ratio: 16/9
|
||||||
|
cover: true
|
||||||
|
back: white
|
||||||
|
multiple: false
|
||||||
|
help:
|
||||||
|
en: "Image displayed before video playback (format: JPEG or PNG). The first image of the video is used if this field is empty."
|
||||||
|
fr: "Image affichée avant la lecture de la vidéo (format : JPEG ou PNG). La première image de la vidéo est utilisée si ce champ est vide."
|
||||||
|
width: 1/4
|
||||||
caption:
|
caption:
|
||||||
label:
|
label:
|
||||||
en: Caption
|
en: Caption
|
||||||
|
|
|
@ -20,9 +20,15 @@
|
||||||
{% for artwork in artworks %}
|
{% for artwork in artworks %}
|
||||||
<figure class="gallery__artwork">
|
<figure class="gallery__artwork">
|
||||||
{% if artwork.type == 'video' %}
|
{% if artwork.type == 'video' %}
|
||||||
<video class="gallery__video" controls playsinline preload="metadata">
|
{% if artwork.poster is not empty %}
|
||||||
<source src="{{ artwork.url }}" type="video/mp4" />
|
<video class="gallery__video" data-poster="{{ artwork.poster.toFile.url }}" preload="metadata" controls playsinline>
|
||||||
</video>
|
<source src="{{ artwork.url }}" type="video/mp4"/>
|
||||||
|
</video>
|
||||||
|
{% else %}
|
||||||
|
<video class="gallery__video" preload="metadata" controls playsinline>
|
||||||
|
<source src="{{ artwork.url }}" type="video/mp4"/>
|
||||||
|
</video>
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if artwork.type == 'image' %}
|
{% if artwork.type == 'image' %}
|
||||||
<img class="gallery__image" src="{{ artwork.url }}" srcset="{{ artwork.srcset() }}" alt="{{ artwork.alt_text }}">
|
<img class="gallery__image" src="{{ artwork.url }}" srcset="{{ artwork.srcset() }}" alt="{{ artwork.alt_text }}">
|
||||||
|
|
|
@ -13,9 +13,9 @@
|
||||||
<nav class="home__nav" aria-label="Menu">
|
<nav class="home__nav" aria-label="Menu">
|
||||||
{% set navItemNo = 1 %}
|
{% set navItemNo = 1 %}
|
||||||
{% for gallery in pages.template('gallery') %}
|
{% for gallery in pages.template('gallery') %}
|
||||||
<div class="home__nav-item-{{ navItemNo }}">
|
<div class="home__nav-item-{{ navItemNo }}">
|
||||||
<a href="{{ gallery.url }}" target="_self" class="home__nav-link">{{ gallery.title }}</a>
|
<a href="{{ gallery.url }}" target="_self" class="home__nav-link">{{ gallery.title }}</a>
|
||||||
</div>
|
</div>
|
||||||
{% set navItemNo = navItemNo + 1 %}
|
{% set navItemNo = navItemNo + 1 %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<div class="home__nav-image" aria-hidden="true">
|
<div class="home__nav-image" aria-hidden="true">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue