hudson
asked 7 years ago

I have the DW event Theme and I want to put a video in the background of the front-page. The section has the video link, but the video is not showing. Also, do you have the documentation for this theme

1 Answers
DominicStaff
answered 7 years ago

Please accept my apology for the delay in getting back to you. I have checked on our demo and it’s a bug come from the theme. To resolve this issue, you can open the view.php file in the dw-events/framework-customizations/extensions/shortcodes/shortcodes/section/views folder.
Then replace the code with the following code:

<?php if ( ! defined( 'FW' ) ) {
 die( 'Forbidden' );
}
 $bg_color = '';
if ( ! empty( $atts['background_color'] ) ) {
 $bg_color = 'background-color:' . $atts['background_color'] . ';';
}
 $bg_image = '';
if ( ! empty( $atts['background_image'] ) && ! empty( $atts['background_image']['data']['icon'] ) ) {
 $bg_image = 'background-image:url( ' . $atts['background_image']['data']['icon'] . ' );';
}
 $bg_video_data_attr = '';
$section_extra_classes = '';
if ( ! empty( $atts['video'] ) ) {
 $filetype = wp_check_filetype( $atts['video'] );
 $filetypes = array( 'mp4' => 'mp4', 'ogv' => 'ogg', 'webm' => 'webm', 'jpg' => 'poster' );
 $filetype = array_key_exists( (string) $filetype['ext'], $filetypes ) ? $filetypes[ $filetype['ext'] ] : 'video';
 $data_name_attr = version_compare( fw_ext('shortcodes')->manifest->get_version(), '1.3.9', '>=' ) ? 'data-background-options' : 'data-wallpaper-options';
 $bg_video_data_attr = $data_name_attr.'="' . fw_htmlspecialchars( json_encode( array( 'source' => array( $filetype => $atts['video'] ) ) ) ) . '"';
 $section_extra_classes .= ' background-video';
}
 $section_style = '';
if ( $bg_color || $bg_image ) {
 $section_style .= $bg_color . $bg_image;
};
if ( ! empty( $atts['background_position'] ) && ! empty( $atts['background_position'] ) ) {
 $section_style .= 'background-position:' . $atts['background_position'] . ';';
}
if ( ! empty( $atts['background_size'] ) && ! empty( $atts['background_size'] ) ) {
 $section_style .= 'background-size:' . $atts['background_size'] . ';';
}
if ( isset( $atts['padding'] ) && $atts['padding'] ) {
 $section_style .= ' padding: ' . $atts['padding'] . '; ';
};
if ( isset( $atts['margin'] ) && $atts['margin'] ) {
 $section_style .= ' margin: ' . $atts['margin'] . '; ';
};
 
if ( isset( $atts['section_height']['selected'] ) && 'custom' == $atts['section_height']['selected'] ) {
 $section_style .= ' height: ' . intval( $atts['section_height']['custom']['height'] ) . 'px; ';
}
 $container_class = ( isset( $atts['is_fullwidth'] ) && $atts['is_fullwidth'] ) ? 'fw-container-fluid' : 'fw-container';
 if ( isset( $atts['remove_columns_gutter'] ) && $atts['remove_columns_gutter'] ) {
 $section_extra_classes .= ' remove-columns-gutter';
}
 if ( isset( $atts['class'] ) && $atts['class'] ) {
 $section_extra_classes .= ' ' . $atts['class'];
}
?>
<section class="fw-main-row <?php echo esc_attr( $section_extra_classes ); ?>" style="<?php echo esc_attr( $section_style ); ?>" <?php echo $bg_video_data_attr; ?>>
 <div class="<?php echo esc_attr( $container_class ); ?>">
 <?php echo do_shortcode( $content ); ?>
 </div>
</section>
Dominic Staff
replied 7 years ago

Also, we have notified to our technical team about this issue, we will fix and update this issue in the next version of the theme.

Powered by DW Question & Answer Pro