Ribbon missing on SharePoint List or Library page SharePoint 2013

This article is related to below post where user reported missing ribbon issue after migration from SharePoint 2007 to 2013 version.

https://social.technet.microsoft.com/Forums/en-US/628b9f7b-b1e7-4bb1-b01d-fcb11b252862/ribbons-missing-after-migration

Scenario:

Ribbon not visible on SharePoint List/Library page load. Mostly reported after site migration from 2007 to 2010/2013 version. Also if you have added a content editor web part on this page.

RibbonMissing

01.<scripttype="text/javascript"src="https://code.jquery.com/jquery-1.11.3.min.js "></script>
02.<scripttype="text/javascript">
03.$(document).ready(function(){
04.var elem = document.getElementById("MSOZoneCell_WebPartWPQ2");
05.           if(elem != null) {
06.                var dummyevent = new Array();
07.                dummyevent["target"] = elem;
08.                dummyevent["srcElement"] = elem;
09.                WpClick(dummyevent);
10.                _ribbonStartInit("Ribbon.Browse", true)
11.            }
12. });
13.</script>
Advertisements

Get icon for different file types SharePoint2010

If you are working in custom search and your search result in returning various file types like

html, pdf, excel or word etc. and you want to show a small icon for corresponding file types then this article will help you.

This function will take parameter as the itemURL and it will return corresponding icon URL. MapToIcon function of SPUtility class will give us the iconURL.


private string GetIconURL(string itemURL)
{
string iconURL = string.Empty;

iconUrl = “/_layouts/images/” + SPUtility.MapToIcon(SPContext.Current.Web, itemURL, string.Empty, IconSize.Size16);

return iconURL;
}

change add new item text sharepoint

Replace “Add New Item” Link Text to Different Link Text SharePoint 2010

This article explore to  user’s requirement is to change “Add New Item” link text to ” Different Link text”, so that it will be more meaningful on list.

This article explore to  user’s requirement is to change “Add New Item” link text to ” Different Link text”, so that it will be more meaningful on list.

By default the “Add new item” appears like below:

change add new item text sharepoint

change add new item text sharepoint

Follow below steps to change the text:

  1. Go to the target page >> Site actions>> Edit Page
  2. Insert a CEWP just below the list view web part.

  3. Place the cursor in CEWP, Click on “Edit HTML Source” link from HTML Ribbon Item’s drop down menu. check fig below:

change add new item text sharepoint

change add new item text SharePoint

4. In Content Editor web part enter the script:
  document.getElementById(“idHomePageNewItem”).innerHTML=”Add New InterviewTracker”

  1. Save the page! see the result in action, it will appear like below:
change add new item text sharepoint

change add new item text sharepoint