Bento Template with options for video background (freemarker)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="bento block-container no-padding "> | |
<#list block.siblings as block> | |
<#assign image_info = "" /> | |
<#assign video_image_info = "" /> | |
<#assign video_info = "" /> | |
<#list block.media.siblings?reverse as cur_media> | |
<#if cur_media.video_type.data?has_content> | |
<#assign video_info = video_info + "<source src='" + cur_media.data + "' type='" + cur_media.video_type.data + "'>" /> | |
<#elseif cur_media.data?has_content> | |
<#assign image_info = image_info + "background-image: url(" + cur_media.data + ");" /> | |
<#assign video_image_info = video_image_info + "<img src='" + cur_media.data + "' >" /> | |
</#if> | |
</#list> | |
<#assign bento_section_css = "bento-section bento-section-${block_index + 1} block ${block.background_color.data} ${block.width.data} ${block.block_class.data}" /> | |
<#assign bento_section_style = "" /> | |
<#if video_info?has_content && !browserSniffer.isMobile(http_servlet_request) && !browserSniffer.isIe(http_servlet_request)> | |
<#assign bento_section_css = bento_section_css + " video-banner" /> | |
<#else> | |
<#assign bento_section_style = "style='${image_info}'" /> | |
</#if> | |
<div class="${bento_section_css}" ${bento_section_style} ${block.data}> | |
<#if video_info?has_content && !browserSniffer.isMobile(http_servlet_request) && !browserSniffer.isIe(http_servlet_request)> | |
<video autoplay class="background-video" height="100%" loop muted width="100%"> | |
${video_info} | |
${video_image_info} | |
</video> | |
</#if> | |
<#if block.article_url_title?has_content> | |
<#list block.article_url_title.siblings as article_url_title> | |
<@article_utilities.embed_journal_article_by_url_title article_url_title.data /> | |
</#list> | |
</#if> | |
</div> | |
</#list> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment