Tag Archives: sharepoint profile icon

How to add Favicon Icon on SharePoint Master Page – SharePoint 2013 Site

<head runat=”server”> <!–SPM:<SharePoint:SPShortcutIcon runat=”server” IconUrl=”/_layouts/15/images/favicon.ico?rev=23″/>–> </head> Advertisements

Posted in SharePoint | Tagged , , , , , , , | Leave a comment

How to get current user id and name in Sharepoint 2013 using Ecma Script

var userid; function GetUserDetails() { clientContext = new SP.ClientContext.get_current(); var oWeb = clientContext.get_web(); currentUser = oWeb.get_currentUser(); clientContext.load(currentUser); clientContext.executeQueryAsync(function () { userid = currentUser.get_id(); usertitle = currentUser.get_title(); }, function (error) { alert(‘Request failed: ‘); }); }

Posted in Uncategorized | Tagged , , , , , , , | Leave a comment

How to get logged in user image in SharePoint 2013 (MySite)

$.ajax({ url: _spPageContextInfo.webAbsoluteUrl + “/_api/SP.UserProfiles.PeopleManager”+ “/GetMyProperties?$select=PictureUrl,DisplayName,AccountName”, type: “GET”, contentType: “application/json;odata=verbose”, headers: { “accept”: “application/json;odata=verbose” }, async: false, success: function (data) { var pic = data.d.PictureUrl; var member = data.d.DisplayName; if (pic) { $(“#userName”).text(member); $(“#paduserName”).text(member); $(“.imageicon”).attr(“src”,pic.Url); } else { $(“#userName”).text(member); $(“#paduserName”).text(member); … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , | Leave a comment