Add Menu PersonalActions Feature at Microsoft.SharePoint.StandardMenu

http://glorix.blogspot.com/2007/08/custom-action-locations-and-groupid.html

I’ve been wandering around the internet to find all the locations that you can define to add your custom action at. You see, I want to add a link near the ‘Welcom <User>, My Site, My Links’ section (aka the global links section). What I found was the following :

Using CustomAction to modify system pages by Chris O’ Brien

  • Microsoft.SharePoint.ContentTypeTemplateSettings
  • Microsoft.SharePoint.ContentTypeSettings
  • Microsoft.SharePoint.Administration.ApplicationCreated
  • Office.Server.ServiceProvider.Administration (Shared Services/SSP links)
  • Microsoft.SharePoint.ListEdit.DocumentLibrary
  • Microsoft.SharePoint.Workflows
  • NewFormToolbar
  • DisplayFormToolbar
  • EditFormToolbar
  • Microsoft.SharePoint.StandardMenu (SiteActions menu)
  • Mcrosoft.SharePoint.Create (_layouts/create.aspx – the screen used to specify what you want to create on your site)
  • Microsoft.SharePoint.ListEdit (the screen used to edit the properties of a list item)
  • EditControlBlock (image below)

That’s more than Microsoft specified on their page How to: Add Actions to the User Interface. But still I didn’t found my answer on how to add a link to the global links section. Then I went looking in the 12/Templates/Controltemplates folder for the usercontrol that renders the ‘Welcome <User>’ section, named “Welcome.ascx”. There I found the following bit :

     <SharePoint:FeatureMenuTemplate runat="server"
         FeatureScope="Site"
         Location="Microsoft.SharePoint.StandardMenu"
         GroupId="PersonalActions"
         id="ID_PersonalActionMenu"
         UseShortId="true"
         >

Now it’s the GroupId that interested me.. So I created a feature that looks this (first part being the feature.xml and the second being the elements.xml) :

<Feature 
  Id="AA929AFF-4602-4d7f-A501-B80AC9A4BB52" 
  Title="Add Links to user section"
  Description="Feature that adds a link to Welcome User section"
  Scope="WebApplication" 
  xmlns="http://schemas.microsoft.com/sharepoint/">
  <ElementManifests>
    <ElementManifest Location="Elements.xml" />
  </ElementManifests>
</Feature>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <CustomAction 
        Id="0acdbd94-eba8-11db-8314-0800200c9a66"
        GroupId="PersonalActions"
        Location="Microsoft.SharePoint.StandardMenu"
        Sequence="1000"
        Title="View Terms of Use"
        Description="Open the Terms of Use document"
        ImageUrl="_layouts/1033/images/KpiListView.png">
        <UrlAction Url="_layouts/termsofuse.aspx"/>
    </CustomAction>
</Elements>

So how does that look in real life I hear you wonder… well like this :

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s