Show Ribbon for ListViewWebPart on Page SharePoint 2013

Show Ribbon for ListViewWebPart on Page SharePoint 2013

In this post, we will discuss how we can show ribbon for listviewwebpart on a page in SharePoint 2013. 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.


Also, you can check:
SharePoint 2012 Delete files or items from a document library or list using PowerShell with conditions like created one month before

InfoPath Replace function in SharePoint 2013

App Step in SharePoint 2013 Designer Workflow

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 does not come like below:

Show Ribbon for ListViewWebPart on Page SharePoint 2013
Show Ribbon for ListViewWebPart on Page SharePoint 2013

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

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

<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 2013
Show Ribbon for ListViewWebPart on Page SharePoint 2013


Hope this will be helpful.

Check out Best Alternative to InfoPath -> Try Now

You May Also like the Following SharePoint Online Tutorials:

About Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SharePointSky.com

View all posts by Bijay Kumar →