-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathHow_to_add_owlcarousel_slider_magento2.txt
99 lines (84 loc) · 2.47 KB
/
How_to_add_owlcarousel_slider_magento2.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
How to add slider using OwlCarousel in Magento2?
Download this module:V4U OwlCarousel
Copy this module and paste in magento-root/app/code folder
Run the following commands:
php bin/magento module:status
php bin/magento module:enable V4U_OwlCarousel
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
php bin/magento cache:clean
You can call slider.phtml file in block by using
{{block class="Magento\Framework\View\Element\Template" template="V4U_OwlCarousel::slider.phtml"}}
Or
Use this code directly in CMS Page & Block
<div class="title>">
<h2>V4U OwlCarousel Slider</h2>
</div>
<div class="owl-carousel owl-theme">
<div class="item">
<h4>1</h4>
</div>
<div class="item">
<h4>2</h4>
</div>
<div class="item">
<h4>3</h4>
</div>
<div class="item">
<h4>4</h4>
</div>
<div class="item">
<h4>5</h4>
</div>
<div class="item">
<h4>6</h4>
</div>
<div class="item">
<h4>7</h4>
</div>
<div class="item">
<h4>8</h4>
</div>
<div class="item">
<h4>9</h4>
</div>
<div class="item">
<h4>10</h4>
</div>
<div class="item">
<h4>11</h4>
</div>
<div class="item">
<h4>12</h4>
</div>
</div>
<script type="text/javascript">
require(['jquery', 'vpowlcarousel'], function ($) {
jQuery(document).ready(function () {
jQuery(".owl-carousel").owlCarousel({
loop:true,
responsiveClass:true,
responsive:{
0:{
items:1,
nav:true,
dots: true,
},
600:{
items:2,
nav:false,
dots: true,
},
1000:{
items:4,
nav:true,
loop:false,
dots: true,
navText: [ "<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"],
}
}
});
});
});
</script>
Support Version: Magento 2.3.x,2.4.x