Professional Documents
Culture Documents
How To Create A Slideshow in Drupal 8 - Swapps
How To Create A Slideshow in Drupal 8 - Swapps
com/blog/how-to-create-a-slideshow-in-drupal-8/
ABOUT US
(HTTPS://SWAPPS.COM
/WEBSITE-MAINTENANCE-
COMPANY-WASHINGTON-
DC/)
BENEFITS
(HTTPS://SWAPPS.COM
/BENEFITS/)
CLIENTS
(HTTPS://SWAPPS.COM
/NONPROFIT-WEB-
DESIGNER-DEVELOPER/)
CAPABILITIES
com/)
swapps.
(https:// (HTTPS://SWAPPS.COM
/AGILE-DRUPAL-
WORDPRESS-WEB-
DEVELOPER-IN-DC/)
BLOG (/BLOG)
(202) 660-2940
(TEL:2026602940)
GET IN TOUCH
(HTTPS://SWAPPS.COM
/CONTACT/)
Drupal 8 (https://swapps.com/blog/tag/drupal-8/)
1 of 11 5/14/2022, 12:20 PM
How to create a slideshow in Drupal 8 - Swapps https://swapps.com/blog/how-to-create-a-slideshow-in-drupal-8/
One of the most used components in web design are slideshows. These
elements allow us to display several pictures and other kinds of information in
a compact and interactive way to our users. You may �nd them in almost all
kinds of websites and for several purposes: display products and o�ers, show
reviews and comments sent by other users, display pictures of a new project,
etc.
Sadly, they are not natively supported by Drupal 8. For this reason, I will show
you how to easily add slideshows support to your Drupal site to make it rock.
For this blog post, we will create a slideshow with famous quotes that we will
add to our sidebar. So, let’s start!
2 of 11 5/14/2022, 12:20 PM
How to create a slideshow in Drupal 8 - Swapps https://swapps.com/blog/how-to-create-a-slideshow-in-drupal-8/
3 of 11 5/14/2022, 12:20 PM
How to create a slideshow in Drupal 8 - Swapps https://swapps.com/blog/how-to-create-a-slideshow-in-drupal-8/
https://malsup.github.io/jquery.cycle.all.js (https://malsup.github.io
/jquery.cycle.all.js)
https://raw.githubusercontent.com/briancherne/jquery-hoverIntent/master
/jquery.hoverIntent.js (https://raw.githubusercontent.com/briancherne/jquery-
hoverIntent/master/jquery.hoverIntent.js)
https://raw.githubusercontent.com/douglascrockford/JSON-js/master/json2.js
(https://raw.githubusercontent.com/douglascrockford/JSON-js/master/json2.js)
If you are using a unix based OS, you may run the following command:
1. mkdir -p libraries/jquery.cycle && cd $_ && wget https://malsup.github.io
/jquery.cycle.all.js && mkdir -p ../../libraries/jquery.hoverIntent && cd $_ && wget
https://raw.githubusercontent.com/briancherne/jquery-hoverIntent/master
/jquery.hoverIntent.js && mkdir -p ../../libraries/json2 && cd $_ && wget
https://raw.githubusercontent.com/douglascrockford/JSON-js/master/json2.js
This command and more related information may be found in the module’s
README.txt �le.
4 of 11 5/14/2022, 12:20 PM
How to create a slideshow in Drupal 8 - Swapps https://swapps.com/blog/how-to-create-a-slideshow-in-drupal-8/
Once you have created the content type, remove the default `body` �eld and
add an `Author` �eld to it. These should be your content type �elds now:
Before continuing, make sure to add some quotes in order to make sure that
your slideshow is working once you have �nished this tutorial.
Considering we are going to add these quotes in our site’s sidebar, we are
5 of 11 5/14/2022, 12:20 PM
How to create a slideshow in Drupal 8 - Swapps https://swapps.com/blog/how-to-create-a-slideshow-in-drupal-8/
creating a block view. Make sure you select Slideshow as the display format
and Quotes as the content type of the block. You may also set the number of
quotes that will be displayed; for now, the default 5 is ok. Once your view is
con�gured, click on “save and edit”
At the end of the page, you should see a preview of your slider. If everything is
working �ne, it should look something like this:
If you are having issues with the styling, you may need to update slides css
settings. You may do it on the blocks settings page, clicking on Format ->
Slideshow -> Settings. Deactivating Add views row classes should �x your
issues.
You may play with other settings to customize your block. Once you have
�nished, save your con�guration.
6 of 11 5/14/2022, 12:20 PM
How to create a slideshow in Drupal 8 - Swapps https://swapps.com/blog/how-to-create-a-slideshow-in-drupal-8/
We are almost done. We are only missing one detail: to display our block. For
this, go to admin/structure/block and place your block in the region you want
to. For our example, we will add it to our sidebar �rst. Simply search for the
region, click on “Place block” and search your new quotes block. Once you are
done, it should appear in your region.
And that’s it. After going to your site, you should see something like this:
In some simple steps, we were able to add a slideshow to our Drupal 8 site that
allows us to handle its content via the admin interface. But this is just a simple
example, using the Views Slideshow module, you may con�gure your block to
retrieve any kind of content: images, urls, etc. You only need to add the content
�elds you want to use to your content type and con�gure your block view to
retrieve them. The possibilities are limitless.
I hope this tutorial will help you to improve your Drupal (https://swapps.com
/blog/category/software-development/web-development/drupal/) site. If you
have any questions, feel free to leave them in the comments section. Happy
coding!
7 of 11 5/14/2022, 12:20 PM
How to create a slideshow in Drupal 8 - Swapps https://swapps.com/blog/how-to-create-a-slideshow-in-drupal-8/
Name
Drupal 8 (https://swapps.com/blog/tag/drupal-8/)
Drupal 8 Slideshow (https://swapps.com/blog/tag/drupal-8-slideshow/)
RELATED ARTICLES
networking/
Networking: key points when preparing for an event (https://swapps.com
/blog/networking/)
(https://swapps.com
By Lina Mercado (https://swapps.com/blog/author/lmercado/)- May 10, 2022
/blog/networking/
8 of 11 5/14/2022, 12:20 PM
How to create a slideshow in Drupal 8 - Swapps https://swapps.com/blog/how-to-create-a-slideshow-in-drupal-8/
Connect with Us
ps://www.facebook.com (https://www.instagram.com (https://www.linkedin.com (https://twitter
/swapps.co) /swappsco/) /company/web-smart- /swappsco
apps)
COMPANY
About us (https://swapps.com/website-
maintenance-company-washington-dc/)
Lab (https://swapps.com/lab/)
Jobs (https://swapps.com/jobs/)
Glossary (https://swapps.com/glossary/)
Contact Us (https://swapps.com/contact/)
SERVICES
Bene�ts (https://swapps.com/bene�ts/)
Capabilities (https://swapps.com/agile-drupal-
wordpress-web-developer-in-dc/)
Clients (https://swapps.com/nonpro�t-web-
designer-developer/)
CONNECT WITH US
9 of 11 5/14/2022, 12:20 PM
How to create a slideshow in Drupal 8 - Swapps https://swapps.com/blog/how-to-create-a-slideshow-in-drupal-8/
Instagram (https://www.instagram.com
/swappsco/)
Facebook (https://www.facebook.com
/swapps.co)
LinkedIn (https://www.linkedin.com/company
/web-smart-apps)
Twitter (https://twitter.com/swappsco)
Blog (https://swapps.com/blog/)
NEWSLETTER
Email address
SEND
results@swapps.com (mailto:results@swapps.co
m)
Located in Ashburn, VA
10 of 11 5/14/2022, 12:20 PM
How to create a slideshow in Drupal 8 - Swapps https://swapps.com/blog/how-to-create-a-slideshow-in-drupal-8/
11 of 11 5/14/2022, 12:20 PM