Drupal 8 - How To Add Load More Button With Views Infinite Scroll Module

Tutorial on how to add a pager option to load more items with Ajax.


drush -y en views_infinite_scroll

Create A View

Go to Structure > Views > Add new view:

Save and edit.

Select Infinite Scroll as the pager:

Theme it

Edit the Content: Title field:

Select the field element as H2:

Add styling (themes/mytheme/less/variable-overrides.less):

.path-views-infinite-scroll {
  h1, .view-views-infinite-scroll {
    text-align: center;

And there we have it:

Autoload Items

In the pager settings select Automatically Load Content to load items when user scrolls down:


Views Infinite Scroll

Samuli Natri built his first website in the late 90’s. He is very passionate about web technologies. He attended Helsinki University Of Technology (Computer Science) and Helsinki University (Social Sciences). He is the founder of WDTutorials.com.

Featured Python Tutorial For Beginners - Essentials In 1 Hour

Copyright @ 2018 WDTutorials.com. All rights reserved. Privacy policy.Terms Of Service.