Yaffs site version 1.1
[yaffs-website] / web / modules / contrib / slick / slick_ui / README.html
1 <h2>Slick Carousel</h2>
2
3 <p>Slick is a powerful and performant slideshow/carousel solution leveraging Ken<br />
4 Wheeler's Slick carousel.<br />
5 See http://kenwheeler.github.io/slick</p>
6
7 <p>Slick has gazillion options, please start with the very basic working<br />
8 samples from <a href="http://dgo.to/slick_extras">slick_example</a> only if trouble to build slicks. Be sure to read<br />
9 its README.txt. Spending 5 minutes or so will save you hours in building more<br />
10 complex slideshows.</p>
11
12 <p>The module supports Slick 1.6 above.<br />
13 Slick 2.x is just out 9/21/15, and hasn't been officially supported now, 9/27.</p>
14
15 <h3>REQUIREMENTS</h3>
16
17 <ul>
18   <li>Slick library:  <br />
19     <ul>
20       <li>Download Slick archive &gt;= 1.6 from https://github.com/kenwheeler/slick/</li>
21       <li>Extract it as is, rename "slick-master" to "slick", so the assets are at:<br />
22         <em>/libraries/slick/slick/slick.css</em><br />
23         <em>/libraries/slick/slick/slick-theme.css</em> (optional if a skin chosen)<br />
24         <em>/libraries/slick/slick/slick.min.js</em>
25       </li>
26     </ul>
27   </li>
28   <li>Download jqeasing from https://github.com/gdsmith/jquery.easing, so available&nbsp; at:<br />
29     <em>/libraries/easing/jquery.easing.min.js</em><br />
30     This is CSS easing fallback for non-supporting browsers.</li>
31   <li>Blazy.module, to reduce DRY stuffs, and as a bonus, advanced lazyloading
32   such as delay lazyloading for below-fold sliders, iframe, (fullscreen) CSS
33   background lazyloading, breakpoint dependent multi-serving images, lazyload
34   ahead for smoother UX.</li>
35 </ul>
36
37 <p>&nbsp; Important! Enable Blazy first before updating Slick Alphas,<br />
38 &nbsp; otherwise a requirement error.</p>
39
40 <h3>FEATURES</h3>
41
42 <ul>
43   <li>Fully responsive. Scales with its container.</li>
44   <li>Uses CSS3 when available. Fully functional when not.</li>
45   <li>Swipe enabled. Or disabled, if you prefer.</li>
46   <li>Desktop mouse dragging.</li>
47   <li>Fully accessible with arrow key navigation.</li>
48   <li>Built-in lazyLoad, and multiple breakpoint options.</li>
49   <li>Random, autoplay, pagers, arrows, dots/text/tabs/thumbnail pagers etc...</li>
50   <li>Supports pure text, responsive image, iframe, video carousels with aspect ratio. No extra jQuery plugin FitVids is required. Just CSS.</li>
51   <li>Works with Views, core and contrib fields: Image, Media Entity.</li>
52   <li>Optional and modular skins, e.g.: Carousel, Classic, Fullscreen, Fullwidth, Split, Grid or a multi row carousel.</li>
53   <li>Various slide layouts are built with pure CSS goodness.</li>
54   <li>Nested sliders/overlays, or multiple slicks within a single Slick via Views.</li>
55   <li>Some useful hooks and drupal_alters for advanced works.</li>
56   <li>Modular integration with various contribs to build carousels with multimedia lightboxes or inline multimedia.</li>
57   <li>Media switcher: Image linked to content, Image to iframe, Image to colorbox, Image to photobox.</li>
58   <li>Cacheability + lazyload = light + fast.</li>
59 </ul>
60
61 <h3>INSTALLATION</h3>
62
63 <p>Install the module as usual, more info can be found on:<br />
64 http://drupal.org/documentation/install/modules-themes/modules-7</p>
65
66 <p>The Slick module has several sub-modules:</p>
67
68 <ul>
69   <li>slick_ui, included, to manage optionsets, can be uninstalled at production.</li>
70   <li><a href="http://dgo.to/slick_media">slick_media</a>, to get richer contents using Media entity.</li>
71   <li><a href="http://dgo.to/slick_video">slick_video</a>, to get video carousels using Video Embed Field.</li>
72   <li><a href="http://dgo.to/slick_paragraphs">slick_paragraphs</a>, to get more complex slides at field level.</li>
73   <li><a href="http://dgo.to/slick_views">slick_views</a>, to get more complex slides.</li>
74   <li><a href="http://dgo.to/slick_extras">slick_extras</a> contains <strong>slick_devel</strong>, if you want to help testing and developing the Slick, and <strong>slick_example</strong>, to get up and running quickly.</li>
75 </ul>
76
77 <h3>OPTIONAL INTEGRATION</h3>
78
79 <p>Slick supports enhancements and more complex layouts.</p>
80
81 <ul>
82   <li>Colorbox, to have grids/slides that open up image/video in overlay.</li>
83   <li>Photobox, idem ditto.</li>
84   <li>Responsive image, in core, to get truly responsive image.</li>
85   <li><a href="http://dgo.to/media_entity">Media Entity</a>, to have richer contents: image, video, or a mix of em.</li>
86   <li><a href="http://dgo.to/video_embed_field">Video Embed Media</a>, idem ditto.</li>
87   <li><a href="http://dgo.to/paragraphs">Paragraphs</a>, to get more complex slides at field level.</li>
88   <li>Mousewheel, download from https://github.com/brandonaaron/jquery-mousewheel, so it is available at:<br />
89   <em>/libraries/mousewheel/jquery.mousewheel.min.js</em></li>
90 </ul>
91
92 <p>&nbsp;</p>
93
94 <h3>OPTIONSETS</h3>
95
96 <p>To create optionsets, go to:</p>
97
98 <p><em>&nbsp; admin/config/media/slick</em></p>
99
100 <p>Enable Slick UI sub-module first, otherwise regular "Access denied".<br />
101 They will be available at field formatter "Manage display", and Views UI.</p>
102
103 <h3>VIEWS AND FIELDS</h3>
104
105 <p>Slick works with Views and as field display formatters.<br />
106 Slick Views is available as a style plugin included at slick_views.module.<br />
107 Slick field formatter included as a plugin which supports core: Image, Text.</p>
108
109 <h3>PROGRAMATICALLY</h3>
110
111 <p>See slick.api.php for samples.</p>
112
113 <h3>NESTED SLICKS</h3>
114
115 <p>Nested slick is a parent Slick containing slides which contain individual child<br />
116 slick per slide. The child slicks are basically regular slide overlays like<br />
117 a single video over the large background image, only with nested slicks it can<br />
118 be many videos displayed as a slideshow as well.<br />
119 Use Slick Paragraphs or Views to build one.<br />
120 Supported multi-value fields for nested slicks: Image, Text, VEF, Media entity.</p>
121
122 <h3>SKINS</h3>
123
124 <p>The main purpose of skins are to demonstrate that often some CSS lines are<br />
125 enough to build fairly variant layouts. No JS needed. Unless, of course, for<br />
126 more sophisticated slider like spiral 3D carousel which is beyond what CSS can<br />
127 do. But more often CSS will do.</p>
128
129 <p>Skins allow swappable layouts like next/prev links, split image or caption, etc.<br />
130 with just CSS. However a combination of skins and options may lead to<br />
131 unpredictable layouts, get yourself dirty. Use the provided samples to see<br />
132 the working skins.</p>
133
134 <p>Some default complex layout skins applied to desktop only, adjust for the mobile<br />
135 accordingly. The provided skins are very basic to support the necessary layouts.<br />
136 It is not the module job to match your awesome design requirements.</p>
137
138 <h4><strong>Optional skins:</strong></h4>
139
140 <p><strong>- None</strong><br />
141 &nbsp; It is all about DIY.<br />
142 &nbsp; Doesn't load any extra CSS other than the basic styles required by slick.<br />
143 &nbsp; Skins at the optionset are ignored, only useful to fetch description and<br />
144 &nbsp; your own custom work when not using the sub-modules, nor plugins.<br />
145 &nbsp; If using individual slide layout, do the layouts yourself.</p>
146
147 <p><strong>- Classic</strong><br />
148 &nbsp; Adds dark background color over white caption, only good for slider (single<br />
149 &nbsp; slide visible), not carousel (multiple slides visible), where small captions<br />
150 &nbsp; are placed over images, and animated based on their placement.</p>
151
152 <p><strong>- Full screen</strong><br />
153 &nbsp; Works best with 1 slidesToShow. Use z-index layering &gt; 8 to position elements<br />
154 &nbsp; over the slides, and place it at large regions. Currently only works with<br />
155 &nbsp; Slick fields, use Views to make it a block. Use Slick Paragraphs to<br />
156 &nbsp; have more complex contents inside individual slide, and assign it to Slide<br />
157 &nbsp; caption fields.</p>
158
159 <p><strong>- Full width</strong><br />
160 &nbsp; Adds additional wrapper to wrap overlay video and captions properly.<br />
161 &nbsp; This is designated for large slider in the header or spanning width to window<br />
162 &nbsp; edges at least 1170px width for large monitor. To have a custom full width<br />
163 &nbsp; skin, simply prefix your skin with "full", e.g.: fullstage, fullwindow, etc.</p>
164
165 <p><strong>- Split</strong><br />
166 &nbsp; Caption and image/media are split half, and placed side by side. This requires<br />
167 &nbsp; any layout containing "split", otherwise useless.</p>
168
169 <p><strong>- Grid</strong><br />
170 &nbsp; Only reasonable if you have considerable amount of slides.<br />
171 &nbsp; Uses the Foundation 5.5 block-grid, and disabled if you choose your own skin<br />
172 &nbsp; not named Grid. Otherwise overrides skin Grid accordingly.</p>
173
174 <p><strong>&nbsp; Requires:</strong><br />
175 &nbsp; Visible slides, Skin Grid for starter, A reasonable amount of slides,<br />
176 &nbsp; Optionset with Rows and slidesPerRow = 1.<br />
177 &nbsp; Avoid variableWidth and adaptiveHeight. Use consistent dimensions.<br />
178 &nbsp; This is module feature, older than core Rows, and offers more flexibility.<br />
179 &nbsp; Available at slick_views, and configurable via Views UI.</p>
180
181 <p>If you want to attach extra 3rd libraries, e.g.: image reflection, image zoomer,<br />
182 more advanced 3d carousels, etc, simply put them into js array of the target<br />
183 skin. Add proper weight, if you are acting on existing slick events,<br />
184 normally &lt; 0 (slick.load.min.js) is the one.</p>
185
186 <p>Use hook_slick_skins_info() and implement \Drupal\slick\SlickSkinInterface<br />
187 to register ones. Clear the cache once.</p>
188
189 <p>See slick.api.php for more info on skins.<br />
190 See \Drupal\slick\SlickSkinInterface.</p>
191
192 <p>Other skins are available at http://dgo.to/slick_extras<br />
193 Some extra skins are WIP which may not work as expected.</p>
194
195 <h3>GRID</h3>
196
197 <p>To create Slick grid or multiple rows carousel, there are 3 options:</p>
198
199 <ol>
200 <li>One row grid managed by library:<br />
201   Visit <em>admin/config/media/slick</em><br />
202   Edit current optionset, and set<br />
203   slidesToShow &gt; 1, and Rows and slidesperRow = 1</li>
204 <li>Multiple rows grid managed by library:<br />
205   Visit <em>admin/config/media/slick</em><br />
206   Edit current optionset, and set<br />
207   slidesToShow = 1, Rows &gt; 1 and slidesPerRow &gt; 1</li>
208 <li>Multiple rows grid managed by Module:<br />
209   Visit <em>admin/structure/views/view/slick_x/edit/block_grid from slick_example</em><br />
210   Install the Slick example sub-module first.<br />
211   Requires skin "Grid", and slidesToShow, Rows and slidesPerRow = 1.</li>
212 </ol>
213
214 <p>The first 2 are supported by core library using pure JS approach.<br />
215 The last is the Module feature using pure CSS Foundation block-grid.</p>
216
217 <p>The key is:<br />
218 The total amount of Views results must be bigger than Visible slides, otherwise<br />
219 broken Grid, see skin Grid above for more details.</p>
220
221 <h3>HTML STRUCTURE</h3>
222
223 <p>Note, non-BEM classes are added by JS.</p>
224
225 <code>
226 &lt;div class="slick"&gt;<br />
227 &nbsp; &lt;div class="slick__slider slick-initialized slick-slider"&gt;<br />
228 &nbsp;&nbsp;&nbsp; &lt;div class="slick__slide"&gt;&lt;/div&gt;<br />
229 &nbsp; &lt;/div&gt;<br />
230 &nbsp; &lt;nav class="slick__arrow"&gt;&lt;/nav&gt;<br />
231 &lt;/div&gt;
232 </code>
233 <p>asNavFor should target slick-initialized class/ID attributes.</p>
234
235 <h3>BUG REPORTS OR SUPPORT REQUESTS</h3>
236
237 <p>A basic knowledge of Drupal site building is required. If you get stuck:</p>
238
239 <ul>
240   <li>consult the provided READMEs,</li>
241   <li>descriptions on each form item,</li>
242   <li>the relevant guidelines from the supported modules,</li>
243   <li>consider the project issue queues, your problem may be already addressed,</li>
244   <li>install slick_example.</li>
245 </ul>
246
247 <p>If you do have bug reports, we love bugs, please:</p>
248
249 <ul>
250   <li>provide steps to reproduce it,</li>
251   <li>provide detailed info, a screenshot of the output and Slick form, or words to identify it any better,</li>
252   <li>make sure that the bug is caused by the module.</li>
253 </ul>
254
255 <p>For the Slick library bug, please report it to the actual library:<br />
256 &nbsp; https://github.com/kenwheeler/slick</p>
257
258 <p>You can create a fiddle to isolate the bug if reproduceable outside the module:<br />
259 &nbsp; http://jsfiddle.net/</p>
260
261 <p>For the support requests, a screenshot of the output and Slick form are helpful.<br />
262 Shortly, you should kindly help the maintainers with detailed info to help you.<br />
263 Thanks.</p>
264
265 <h3>TROUBLESHOOTING</h3>
266 <ul>
267   <li>When upgrading from Slick v1.3.6 to later version, try to resave options at:<br />
268     <ul>
269       <li><em>admin/config/media/slick</em></li>
270       <li><em>admin/structure/types/manage/CONTENT_TYPE/display</em></li>
271       <li><em>admin/structure/views/view/VIEW_NAME</em><br />
272       only if trouble to see the new options, or when options don't apply properly.<br />
273       Most likely true when the library adds/changes options, or the module<br />
274       does something new. This is normal for any library even commercial ones, so<br />
275       bear with it.</li>
276     </ul>
277   </li>
278   <li>Always clear the cache, and re-generate JS (if aggregation is on) when<br />
279   updating the module to ensure things are picked up:<br />
280   <em>admin/config/development/performance</em></li>
281   <li>If you are customizing template files, or theme functions, re-check against the latest.</li>
282
283   <li>Slick release is similar, or later than Blazy.</li>
284 </ul>
285
286 <h3>KNOWN ISSUES</h3>
287
288 <ul>
289   <li>Slick admin CSS may not be compatible with private or contrib admin<br />
290   themes. Only if trouble with admin display, please disable it at:<br />
291   admin/config/media/blazy</li>
292   <li>The Slick lazyLoad is not supported with Responsive image. Slick only<br />
293   facilitates Responsive image to get in. The image formatting is taken over by<br />
294   Responsive image.<br />
295   Some other options such as Aspect ratio is currently not supported either.</li>
296   <li>Photobox is best for:<br />
297   - infinite true + slidesToShow 1<br />
298   - infinite false + slidesToShow N<br />
299   If "infinite true + slidesToShow &gt; 1" is a must, but you don't want dup<br />
300   thumbnails, simply override the JS to disable 'thumbs' option.</li>
301   <li>The following is not module related, but worth a note:<br />
302     <ul>
303       <li>lazyLoad ondemand has issue with dummy image excessive height.<br />
304       Added fixes to suppress it via option Aspect ratio (fluid | enforced).<br />
305       Or use Blazy lazyload for more advanced options.</li>
306       <li>Aspect ratio is not compatible with Responsive image or multi-serving<br />
307       images.<br />
308       However if you can stick to one Aspect ratio, choose 'enforced' instead.<br />
309       Otherwise disable Aspect ratio for multi-serving images.</li>
310       <li>If the total &lt; slidesToShow, Slick behaves. Previously added a workaround to<br />
311       fix this, but later dropped and handed over to the core instead.<br />
312       Brought back the temp fix for 1.6+ as per 10/18/16:<br />
313       See https://github.com/kenwheeler/slick/issues/262</li>
314       <li>Fade option with slideToShow &gt; 1 will screw up.</li>
315       <li>variableWidth ignores slidesToShow.</li>
316       <li>Too much centerPadding at small device affects slidesToShow.</li>
317       <li>Infinite option will create duplicates or clone slides which look more<br />
318       obvious if slidesToShow &gt; 1. Simply disable it if not desired.</li>
319       <li>If thumbnail display is Infinite, the main one must be infinite too, else<br />
320       incorrect syncing.</li>
321       <li>adaptiveHeight is no good for vertical.</li>
322     </ul>
323   </li>
324 </ul>
325
326 <h3>CURRENT DEVELOPMENT STATUS</h3>
327
328 <p>A full release should be reasonable after proper feedback from the community,<br />
329 some code cleanup, and optimization where needed. Patches are very much welcome.</p>
330
331 <p>Alpha and Beta releases are for developers only. Be aware of possible breakage.</p>
332
333 <p>However if it is broken, unless an update is explicitly required, clearing cache<br />
334 should fix most issues during DEV phases.</p>
335 <ul>
336   <li>Prior to any update, always visit:
337   <em>/admin/config/development/performance</em></li>
338   <li>Hit "Clear all caches" button once the new Slick is in place.</li>
339   <li>Regenerate CSS and JS as the latest fixes may contain changes to the assets.</li>
340   <li>Have the latest or similar release Blazy to avoid trouble in the first place.</li>
341 </ul>
342
343 <h3>ROADMAP</h3>
344
345 <p>- Bug fixes, code cleanup, optimization, and full release.</p>
346
347 <h3>HOW CAN YOU HELP?</h3>
348
349 <p>Please consider helping in the issue queue, provide improvement, or helping with documentation.</p>
350
351 <p>If you find this module helpful, please help back spread the love. Thanks.</p>
352
353 <h3>QUICK PERFORMANCE TIPS</h3>
354 <ul>
355   <li>Use lazyLoad "ondemand" / "anticipated" for tons of images, not "progressive".
356    Unless within an ajaxified lightbox.</li>
357   <li>Choose lazyload "Blazy" for carousels below the fold to delay loading them.</li>
358   <li>Tick "Optimized" option on the top right of Slick optionset edit page.</li>
359   <li>Use image style with regular sizes containing effect "crop" in the name. This
360   way all images will inherit dimensions calculated once.</li>
361   <li>Disable core library "slick-theme.css" as it contains font "slick" which
362   may not be in use when using own icon font at:
363   /admin/config/media/slick/ui</li>
364   <li>Use Blazy multi-serving images, Responsive image, or Picture, accordingly.</li>
365   <li>Uninstall Slick UI at production.</li>
366   <li>Enable Drupal cache, and CSS/ JS assets aggregation.</li>
367 </ul>
368
369 <h3>AUTHOR/MAINTAINER/CREDITS</h3>
370
371 <p>Slick 8.x-1.x by gausarts, and other authors below.<br />
372 Slick 7.x-2.x by gausarts, inspired by Flexslider with CTools integration.<br />
373 Slick 7.x-1.x by arshadcn, the original author.</p>
374
375 <p>- https://www.drupal.org/node/2232779/committers<br />
376 - CHANGELOG.txt for helpful souls with their patches, suggestions and reports.</p>
377
378 <h3>READ MORE</h3>
379
380 <p>See the project page on drupal.org: http://drupal.org/project/slick.</p>
381
382 <p>More info relevant to each option is available at their form display by hovering<br />
383 over them, and click a dark question mark.</p>
384
385 <p><strong>See the Slick docs at:</strong><br />
386 - http://kenwheeler.github.io/slick/<br />
387 - https://github.com/kenwheeler/slick/</p>