| 1 |
<?php |
| 2 |
/** |
| 3 |
* The template for Element Listing Images Slider. |
| 4 |
* This is the template that elementor element slider, carousel |
| 5 |
* |
| 6 |
*/ |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
exit; // Exit if accessed directly. |
| 10 |
} |
| 11 |
|
| 12 |
?> |
| 13 |
<div class="wdk-element" id="wdk_el_<?php echo esc_html($id_element);?>"> |
| 14 |
<div class="wdk-listing-sliders"> |
| 15 |
<?php if(count($images) > 0):?> |
| 16 |
<div class="wdk_listing_slider_box <?php echo esc_attr($settings['layout_carousel_animation_style']).'_animation';?> <?php echo esc_attr(join(' ', [$settings['styles_carousel_dots_position_style'], $settings['styles_carousel_arrows_position_style'],$settings['styles_carousel_arrows_position'],$settings['styles_carousel_arrows_position_style']]));?>"> |
| 17 |
<div class="wdk_listing_slider_ini"> |
| 18 |
<?php foreach($images as $image):?> |
| 19 |
<?php if(!wmvc_show_data('wdk_listing_video_disabled',$settings, false) && wdk_file_extension_type(wmvc_show_data('src',$image)) == 'video'):?> |
| 20 |
<div class="wdk-col"> |
| 21 |
<div class="wdk-listing-image-card"> |
| 22 |
<video controls src="<?php echo esc_url(wmvc_show_data('src',$image));?>" alt="<?php echo esc_attr(wmvc_show_data('alt',$image));?>" class="wdk-listing-image <?php if($settings['enable_fixed_height']!='yes'):?> auto_height <?php endif;?>"></video> |
| 23 |
</div> |
| 24 |
</div> |
| 25 |
<?php elseif(wdk_file_extension_type(wmvc_show_data('src',$image)) == 'image'):?> |
| 26 |
<div class="wdk-col"> |
| 27 |
<div class="wdk-listing-image-card"> |
| 28 |
<img src="<?php echo esc_url(wmvc_show_data('src',$image));?>" class="wdk-listing-image <?php if($settings['enable_fixed_height']!='yes'):?> auto_height <?php endif;?>" alt="<?php echo esc_attr(wmvc_show_data('alt',$image));?>"> |
| 29 |
</div> |
| 30 |
</div> |
| 31 |
<?php endif;?> |
| 32 |
<?php endforeach;?> |
| 33 |
|
| 34 |
<?php if(!empty($images) && 1 < wmvc_count($images)):?> |
| 35 |
</div> |
| 36 |
<div class="wdk-listing-sliders_arrows"> |
| 37 |
<a class="wdk-slider-prev wdk-listing-sliders_arrow"> |
| 38 |
<?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_arrows_icon_left'], [ 'aria-hidden' => 'true' ] ); ?> |
| 39 |
</a> |
| 40 |
<a class="wdk-slider-next wdk-listing-sliders_arrow"> |
| 41 |
<?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_arrows_icon_right'], [ 'aria-hidden' => 'true' ] ); ?> |
| 42 |
</a> |
| 43 |
</div> |
| 44 |
</div> |
| 45 |
<?php else:?> |
| 46 |
</div> |
| 47 |
</div> |
| 48 |
<?php endif;?> |
| 49 |
<?php endif;?> |
| 50 |
|
| 51 |
<?php if(count($images) > 1):?> |
| 52 |
<div class="wdk-cls-banner-thumbs"> |
| 53 |
<div class="banner-thumbs"> |
| 54 |
<?php foreach($images as $image):?> |
| 55 |
<?php if(!wmvc_show_data('wdk_listing_video_disabled',$settings, false) && wdk_file_extension_type(wmvc_show_data('src',$image)) == 'video'):?> |
| 56 |
<div class="banner-thumb"> |
| 57 |
<video src="<?php echo esc_url(wmvc_show_data('src',$image));?>" alt="<?php echo esc_attr(wmvc_show_data('alt',$image));?>" class="wdk-listing-image <?php if($settings['enable_fixed_height']!='yes'):?> auto_height <?php endif;?>"></video> |
| 58 |
</div> |
| 59 |
<?php elseif(wdk_file_extension_type(wmvc_show_data('src',$image)) == 'image'):?> |
| 60 |
<div class="banner-thumb"> |
| 61 |
<img src="<?php echo esc_url(wmvc_show_data('src',$image));?>" class="wdk-listing-image <?php if($settings['enable_fixed_height']!='yes'):?> auto_height <?php endif;?>" alt="<?php echo esc_attr(wmvc_show_data('alt',$image));?>"> |
| 62 |
</div> |
| 63 |
<?php endif;?> |
| 64 |
<?php endforeach;?> |
| 65 |
</div><!--banner-thumbs end--> |
| 66 |
</div> |
| 67 |
<?php endif;?> |
| 68 |
</div> |
| 69 |
<script> |
| 70 |
jQuery(document).ready(function($){ |
| 71 |
$('#wdk_el_<?php echo esc_html($id_element);?> .wdk_listing_slider_ini').slick({ |
| 72 |
<?php if(1 < wmvc_count($images)):?> |
| 73 |
dots: true, |
| 74 |
arrows: true, |
| 75 |
<?php else:?> |
| 76 |
dots: false, |
| 77 |
arrows: false, |
| 78 |
<?php endif;?> |
| 79 |
slidesToShow: 1, |
| 80 |
slidesToScroll: 1, |
| 81 |
<?php if(!empty(wmvc_show_data('layout_carousel_is_infinite', $settings))):?> |
| 82 |
infinite: <?php echo wmvc_show_data('layout_carousel_is_infinite', $settings, 'true');?>, |
| 83 |
<?php endif;?> |
| 84 |
<?php if(!empty(wmvc_show_data('layout_carousel_is_autoplay', $settings))):?> |
| 85 |
autoplay: <?php echo wmvc_show_data('layout_carousel_is_autoplay', $settings, 'false');?>, |
| 86 |
<?php endif;?> |
| 87 |
autoplaySpeed: '<?php echo esc_html($settings['layout_carousel_speed'], '100');?>', |
| 88 |
<?php if(in_array($settings['layout_carousel_animation_style'], ['fade','fade_in'])):?> |
| 89 |
fade: true, |
| 90 |
<?php endif;?> |
| 91 |
nextArrow: $('#wdk_el_<?php echo esc_html($id_element);?> .wdk-listing-sliders_arrows .wdk-slider-next'), |
| 92 |
prevArrow: $('#wdk_el_<?php echo esc_html($id_element);?> .wdk-listing-sliders_arrows .wdk-slider-prev'), |
| 93 |
customPaging: function(slider, i) { |
| 94 |
// this example would render "tabs" with titles |
| 95 |
return '<span class="wdk_dot"><?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_dots_icon'], [ 'aria-hidden' => 'true' ] ); ?></span>'; |
| 96 |
}, |
| 97 |
responsive: [ |
| 98 |
{ |
| 99 |
breakpoint: 600, |
| 100 |
settings: { |
| 101 |
slidesToShow: 1, |
| 102 |
slidesToScroll: 1 |
| 103 |
} |
| 104 |
}, |
| 105 |
] |
| 106 |
}); |
| 107 |
|
| 108 |
$('#wdk_el_<?php echo esc_html($id_element);?> .banner-thumbs').slick({ |
| 109 |
asNavFor: '#wdk_el_<?php echo esc_html($id_element);?> .wdk_listing_slider_ini', |
| 110 |
dots: false, |
| 111 |
arrows: false, |
| 112 |
focusOnSelect: true, |
| 113 |
slidesToScroll: 1, |
| 114 |
|
| 115 |
|
| 116 |
<?php if(wmvc_show_data('layout_carousel_nav_is_infinite', $settings) == 'true'):?> |
| 117 |
infinite: <?php echo wmvc_show_data('layout_carousel_nav_is_infinite', $settings, 'true');?>, |
| 118 |
<?php endif;?> |
| 119 |
|
| 120 |
<?php if(!empty(wmvc_show_data('layout_carousel_nav_speed', $settings))):?> |
| 121 |
speed: <?php echo intval(wmvc_show_data('layout_carousel_nav_speed', $settings, 100));?>, |
| 122 |
<?php endif;?> |
| 123 |
|
| 124 |
<?php if(wmvc_show_data('layout_carousel_nav_is_center', $settings) == 'true'):?> |
| 125 |
centerMode: true, |
| 126 |
<?php endif;?> |
| 127 |
|
| 128 |
<?php if(wmvc_show_data('layout_carousel_nav_is_autoplay', $settings) == 'true'):?> |
| 129 |
autoplay: true, |
| 130 |
<?php endif;?> |
| 131 |
|
| 132 |
<?php if(!empty(wmvc_show_data('layout_carousel_nav_autoplay_speed', $settings))):?> |
| 133 |
autoplaySpeed: <?php echo intval(wmvc_show_data('layout_carousel_nav_autoplay_speed', $settings, 2000));?>, |
| 134 |
<?php endif;?> |
| 135 |
|
| 136 |
<?php if(wmvc_show_data('layout_carousel_nav_variableWidth', $settings) == 'true'):?> |
| 137 |
variableWidth: true, |
| 138 |
<?php endif;?> |
| 139 |
|
| 140 |
slidesToShow: <?php echo (!empty(trim(wmvc_show_data('styles_thmbn_nav_columns', $settings, '4')))) ? wmvc_show_data('styles_thmbn_nav_columns', $settings, '4') : 4;?>, |
| 141 |
responsive: [ |
| 142 |
{ |
| 143 |
breakpoint: 991, |
| 144 |
settings: { |
| 145 |
slidesToShow: <?php echo (!empty(trim(wmvc_show_data('styles_thmbn_nav_columns_tablet', $settings, '3')))) ? wmvc_show_data('styles_thmbn_nav_columns_tablet', $settings, '3') : 3;?>, |
| 146 |
} |
| 147 |
}, |
| 148 |
{ |
| 149 |
breakpoint: 768, |
| 150 |
settings: { |
| 151 |
slidesToShow: <?php echo (!empty(trim(wmvc_show_data('styles_thmbn_nav_columns_mobile', $settings, '2')))) ? wmvc_show_data('styles_thmbn_nav_columns_mobile', $settings, '2') : 2;?>, |
| 152 |
} |
| 153 |
}, |
| 154 |
] |
| 155 |
}); |
| 156 |
}) |
| 157 |
</script> |
| 158 |
</div> |
| 159 |
|
| 160 |
|