Show Ribbon for ListViewWebPart on Page SharePoint 2013/2016/Online

This SharePoint tutorial we will discuss, how to show ribbon for listviewwebpart on a page in SharePoint 2013/2016/Online.

By default, if you have multiple list view web part in page sometimes you will be able to see the Files and Libraries tab in the ribbon for document libraries. Or if you have listed in the page you may not see the ITEMS & List tab.

After you select the list view web part then the tabs for the corresponding list or libraries appears. Recently in one of my site few business users come saying we were not able to see the Files and Libraries tab then how could we upload the document.

First, we have a solution saying select a row then ribbon will appear but something they do not want to do like that.

So whenever they open a page list view ribbons options do not come like below:

Show Ribbon for ListViewWebPart on Page SharePoint

Then we got one solution from MSDN which works perfectly for us.

Show Ribbon for ListViewWebPart on Page SharePoint

Just put the below code in a script editor web part in the page in SharePoint.

<script language="javascript" type="text/javascript">
ExecuteOrDelayUntilScriptLoaded(ShowContextRibbonSections, "sp.ribbon.js");

function ShowContextRibbonSections(){
var initInfo = {
editable: true,isEditMode: false,allowWebPartAdder: false
};
SP.Ribbon.WebPartComponent.registerWithPageManager(initInfo);
var wpcomp = SP.Ribbon.WebPartComponent.get_instance();
if(wpcomp){
var zc = document.getElementById("MSOZoneCell_WebPartWPQ3");
wpcomp.selectWebPart(zc, true);
}
}

</script>

MSOZoneCell_WebPartWPQ3: Here for the particular web part zone you can get the id by using firebug or by inspecting element in chrome browser.

Once we put the code and save the page, it appears like below:

Show Ribbon for ListViewWebPart on Page SharePoint Online

You may like following SharePoint tutorials:

This SharePoint tutorial explains, how to Show Ribbon for ListViewWebPart on Page SharePoint 2013/2016 or SharePoint Online.

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

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

>