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:
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:
You may like following SharePoint tutorials:
- How to Embed Facebook Page into SharePoint Online Modern Site Page
- Create and Deploy SharePoint 2013 site pages or content pages using Visual Studio 2013
- Create site page option missing in SharePoint Online modern sites
- Site pages library missing in SharePoint Online/2013/2016/2019
- Create subsite and Page using JavaScript jQuery in SharePoint 2016/2013/Online
- New Page option not appearing under the Site Actions menu for sites created using Blank Site Template in SharePoint 2010
- Change welcome page in SharePoint Online/2013/2016
- Cannot create a site page. please have your administrator enable the required feature on this site
This SharePoint tutorial explains, how to Show Ribbon for ListViewWebPart on Page SharePoint 2013/2016 or SharePoint Online.
Bhawana Rathore is a Microsoft MVP (3 times in Office Apps & Services) and a passionate SharePoint Consultant, having around 10 years of IT experience in the industry, as well as in .Net technologies. She likes to share her technical expertise in EnjoySharePoint.com and SPGuides.com