Skip to content

Instantly share code, notes, and snippets.

@pigeonflight
Created November 20, 2017 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pigeonflight/80cb4f51e9bd538b82b3895ad60a38d0 to your computer and use it in GitHub Desktop.
Save pigeonflight/80cb4f51e9bd538b82b3895ad60a38d0 to your computer and use it in GitHub Desktop.
Video Tile Fragment for Plone, Mosaic + Theme Fragments
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<style>
section.videobg-fragment {
overflow: hidden;
background-size:cover;
background-image:url('${portal_url}/++theme++praisetheme/img/video-placeholder.svg');
}
.video-background {
/* making the video fullscreen */
right: 0;
bottom: 0;
min-width: 100%;
min-height: 100%;
width: auto;
height: auto;
z-index: -100;
}
.videobg-fragment h1 {
font-weight: 700;
font-size: 300%;
color: white;
position: absolute;
left: 32px;
text-transform: uppercase;
z-index: 1;
}
</style>
<!-- Content -->
<section class="videobg-fragment">
<h1>${view/data/video_title}</h1>
<video autoplay loop class="video-background" muted plays-inline>
<source src="${portal_url}/${view/data/video_url}">
</video>
</section>
<model xmlns:form="http://namespaces.plone.org/supermodel/form"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
xmlns:indexer="http://namespaces.plone.org/supermodel/indexer"
xmlns:lingua="http://namespaces.plone.org/supermodel/lingua"
xmlns:marshal="http://namespaces.plone.org/supermodel/marshal"
xmlns:security="http://namespaces.plone.org/supermodel/security"
xmlns:users="http://namespaces.plone.org/supermodel/users"
xmlns="http://namespaces.plone.org/supermodel/schema">
<schema>
<field name="video_title" type="zope.schema.TextLine">
<description/>
<required>False</required>
<title>Video Title</title>
<default>Video</default>
</field>
<field name="video_url" type="zope.schema.TextLine">
<description/>
<required>False</required>
<title>Video URL</title>
<default>video.mp4</default>
</field>
</schema>
</model>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment