Display more than 3 views (en)


More than  views en title
, , ,

You build a lot of views but you always have the problem, that only three views are shown?

I often had this question by my customers, so I thought this is interesting for everybody.

More than 3 views (en)_1

Maybe you have four or more views, you want to show?

More than 3 views (en)_2

No problem. We will fix that right now!

Open the site with your library or list where you want to show more views.
Edit the page and add an Script Editor.

More than 3 views (en)_3

Click on EDIT SNIPPET

More than 3 views (en)_4

And now paste the following script and click on Insert:

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

function overrideSurfacePivotCount() {
   ClientPivotControl.prototype.SurfacedPivotCount = 4;
};
</script>

More than 3 views (en)_5 NOTE: You can also save the above script in a .js file to attach it to you webpart. How you can do that is shown here. Also if you have more than 4 views you want to show, let's say 6, you simply change the column:

ClientPivotControl.prototype.SurfacedPivotCount = 4;
to this:
ClientPivotControl.prototype.SurfacedPivotCount = 6;
Click on Stop Editing and you will see the pure awesomeness. More than 3 views (en)_6 Hope you like this new afraIT Shorty. If you do, you are free to share it wherever you want. You can also check out the whole category of Shortys Also you can follow me on Twitter or Facebook.

Leave a Reply

Your email address will not be published. Required fields are marked *