Where do “My site” and “My profiles” links come from?
-
07-12-2019 - |
Question
Under the personal action menu, there are two links :
- My site
- My profile
I'm trying to understand how they are generated and by which component/feature. However the highest container in the control hierarchy I was able to discover is the FeatureMenuTemplate
control, within PersonalActions
control (itself in the welcome.ascx control).
If I replace the Welcome.ascx by a custom one with this minimal content :
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" Inherits="Microsoft.SharePoint.WebControls.Welcome,Microsoft.SharePoint,Version=14.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" AutoEventWireup="false" compilationMode="Always" %>
<SharePoint:PersonalActions accesskey="<%$Resources:wss,personalactions_menu_ak%>" ToolTip="<%$Resources:wss,open_menu%>" runat="server" id="ExplicitLogout" Visible="false">
<CustomTemplate>
<SharePoint:FeatureMenuTemplate runat="server"
FeatureScope="None"
Location="Microsoft.SharePoint.StandardMenu"
GroupId="PersonalActions"
id="ID_PersonalActionMenu"
UseShortId="true"
>
<SharePoint:MenuItemTemplate runat="server" id="ID_LoginAsDifferentUser"
Text="<%$Resources:wss,personalactions_loginasdifferentuser%>"
Description="<%$Resources:wss,personalactions_loginasdifferentuserdescription%>"
MenuGroupId="200"
Sequence="100"
UseShortId="true"
/>
</SharePoint:FeatureMenuTemplate>
</CustomTemplate>
</SharePoint:PersonalActions>
<SharePoint:ApplicationPageLink runat="server" id="ExplicitLogin"
ApplicationPageFileName="Authenticate.aspx" AppendCurrentPageUrl="true"
Text="<%$Resources:wss,login_pagetitle%>" style="display:none" Visible="false" />
This works, but there are still the two links mentionned before.
I tried to dive with reflector to understand how these links are generated. I tried to find any custom action. No success.
What is causing this two links to appear ?
PS: my actual goal is to remve this links, I found some workaround on the web but I'm still looking for an explanation, for my personal comprehension (and sanity)
Solution
I finally found how all the things is working.
First, there is a server control SocialNavigationControl
. This control is rendered within SocialData.ascx
.
There is also a delegate control override in SocialDelegateControl.xml
file of SocialRibbonControl
feature. This override applies to GlobalSiteLink2
delegate control.
Finally, the v4.master
page references this control using a standard <SharePoint:DelegateControl ControlId="GlobalSiteLink2" ID="GlobalDelegate2" Scope="Farm" runat="server" />
declaration.
I was looking in the wrong control. This is not the Welcome.ascx
that populates the links, but another control which is adding controls when rendering using (I guess) Ribbons's JS api.
OTHER TIPS
If you donot need the MySite and MyProfile... Then you can disable the feature as follows
1.Central Administration>Manage Service Applications>User Profile Service Application>People>Manage User Permissions>Select All Authenticated Users>Uncheck *Use Personal Features* >Click Ok
2.Central Administration>Manage Services on server>Stop *User Profile Service*