Show more or all views in a classic view SharePoint list

ViewCount

By default, you’ll see 3 views in a SharePoint list. Using simple javascript, we can make sure our users see that fourth or fifth view as well, reducing the number of clicks it takes for them to get to the data they need.

Save the Scripts to your Site Assets

You’ll need a separate script in your site assets file for each number of views. I would recommend having multiple scripts in your Site Assets ready to be used at any time. That way if you add a view later, you just have to change the last number in your CEWP’s script field to update it. Just download the files you want and save them to your site’s Site Assets folder.

Alternatively, you can follow the directions below to create your own javascript files using SharePoint Designer. Just change the “5” in the script to the number of views you want to show and make sure your filename number matches. Skip to the next section if you just downloaded and saved the scripts.

  1. From within SharePoint Designer, click Site Assets
    2017-09-12_08-04-23.gif
  2. Click the Asset dropdown, then JavaScript
    2017-09-12_08-04-39.gif
  3. Name the file view-count-5.js, hit enter to save the name change
  4. Right-click the new file, and then click Edit File in Advanced Mode
    2017-09-12_08-32-17.gif
  5. Paste the following script and save the file
    [code]
    <script type="text/javascript">
    ExecuteOrDelayUntilScriptLoaded(overrideSurfacePivotCount, ‘clienttemplates.js’);

    function overrideSurfacePivotCount() {
    ClientPivotControl.prototype.SurfacedPivotCount = 5;
    };
    </script>
    [/code]

Add the Script to a List

  1. Go to your list for which you’d like to show more views
  2. Settings –> Edit page
    2017-09-12_08-13-55
  3. Add web part
    2017-09-12_08-14-19.gif
  4. Add Content Editor Web Part (Media and Content–> Content Editor –> Add)
    2017-09-12_08-14-40.gif
  5. Edit the new web part’s properties
    2017-09-12_08-15-00.gif
  6. Get the URL for your script (i.e. /SiteCollection/SiteAssets/view-count-5.js). Here’s how to do that in SharePoint Designer:
    1. Right-click script –> Properties
      2017-09-12_08-16-00
    2. Copy URL
      3.PNG
  7. Paste into CEWP and click OK
    2017-09-12_08-17-26
  8. Stop Editing/Save Page
    2017-09-12_08-17-39.gif
  9. That’s it! You should now see the number of views that match the script you pasted.
    ViewCount

4 Replies to “Show more or all views in a classic view SharePoint list”

  1. Hi,

    Thanks it works, but it also displays the “Modify this view” and “Create View”. I would like to have those two to only show when i click on the ellipses, or they only display to me simply because I’m an administrator on of the site?

  2. works just for default view – ‘all items’, if you click on some view within a list, the list of views would be trimmed to the default 3…

Leave a Reply to SharePoint LibrarianCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.