Articles


Create a Slideshow in Drupal8

Create a Slideshow in Drupal8



Posted byKala,7th Feb 2017

The slide show is a functionality to create a presentation of a series of images or data. With the help of views, modules, easily we can create slideshow in Drupal.

For creating a slideshow in a drupal8, we need to install 'Views Slideshow' module and appropriate libraries. It helps us to create the slideshow of any content appear in a Views and customizable too. Without the libraries the Slideshow won't work. It only displays the last slide without any transition.

Required libraries are :


  https://malsup.github.io/jquery.cycle.all.js
  http://cherne.net/brian/resources/jquery.hoverIntent.js
  https://raw.githubusercontent.com/douglascrockford/JSON-js/master/json2.js

Create a /libraries/jquery.cycle/ folder and save these files.

OR

We can also download it from the https://github.com/malsup/cycle. Then Extract the downloaded folder and rename it as 'jquery.cycle' and save it into the /libraries/ of our project folder.

OR

we can use the terminal to save the libraries :


&&mkdir -p libraries/jquery.cycle && cd $_ && wget https://malsup.github.io/jquery.cycle.all.js \
&&mkdir -p ../../libraries/jquery.hoverIntent && cd $_ && wget http://cherne.net/brian/resources/jquery.hoverIntent.js \
&& mkdir -p ../../libraries/json2 && cd $_ && wget https://raw.githubusercontent.com/douglascrockford/JSON-js/master/json2.js

It requires proper updates too , then just it works splendidly.

Now you can create a block view of a content type with image field and choose the 'Display format' as 'Slideshow', as well as choosing the image style.

Finally, you can add controls for the slideshow including Previous / Next buttons, a counter and a pager.

Categories