How to display more than 3 views in SharePoint 2013/2016/Online list or document library

This SharePoint customization tutorial, we will discuss, how to display/show more than three views in SharePoint 2013 list or document library.

The same script code we can use in SharePoint 2013/2016 or in SharePoint Online to show more than three views in SharePoint list or library.

By default if you open any SharePoint list or document library, then you can see it will see 3 views in the page and rest of the views you can see after clicking on the (…) like below:

display more than 3 views in SharePoint list or document library

As you can see in this example, you will be able to see 3 links like All Items, View-1 & View-2 and rest two views we can see after clicking on the … button.

Display more than 3 views in SharePoint List or Library

We can add a few lines of script code to display more than 3 views in SharePoint list or libraries.

Open the SharePoint list or library and then Edit the page. Then add a Web Part and then from the web part categories select Media and Content and then choose Script Editor web part like below:

display more than 3 views in SharePoint 2013 list or document library

Then click on EDIT SNIPPET and then put the below code.

<script type="text/javascript">
ExecuteOrDelayUntilScriptLoaded(IncreaseSurfacePivotCount, 'clienttemplates.js');

function IncreaseSurfacePivotCount() {
ClientPivotControl.prototype.SurfacedPivotCount = 5;
};
</script>

Here 5 is the number of views you want to appear on the page.

Then Save the page.. Once you refresh the page you can see all 4 list views are appearing like below:

display more than 3 views in SharePoint online list or document library

Below is a screen show from how it is appearing in a SharePoint 2016 list.

display more than 3 views in SharePoint 2016 list

You may like following SharePoint list or library tutorials:

Hope this will be helpful to know how to display more than 3 views in SharePoint 2013/2016 or SharePoint Online list or document library.

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

  • Hi, this is working well in my environment (fully patched sp2013 Foundation), however when applied I lose the Items and List ribbon menu tabs. Verified by removing the script. Is there a way around this?

  • >