2

Im trying to implement a custom action in the logged in user dropdown (when you click 'sp_admin' in the image below).

The custom action should be a text called "Switch user", which when clicked executes a javascript function.

How do I accomplish this? What value should be used in CustomAction location for starters?

Settings dropdown

1 Answer 1

1

You have an Out Of The Box behaviour that must be activated in the Welcome.ascx inside {SharePointRoot}\Template\CONTROLTEMPLATES folder.

Localize this code in Welcome.ascx

<SharePoint:MenuItemTemplate runat="server" id="ID_RequestAccess"
             Text="<%$Resources:wss,personalactions_requestaccess%>"
             Description="<%$Resources:wss,personalactions_requestaccessdescription%>"
             MenuGroupId="100"
             UseShortId="true"
             Sequence="300"
             />

Under this code paste this other

<SharePoint:MenuItemTemplate runat="server" ID="ID_LoginAsDifferentUser"
                Text="<%$Resources:wss,personalactions_loginasdifferentuser%>"
                Description="<%$Resources:wss,personalactions_loginasdifferentuserdescription%>"
                MenuGroupId="100"
                Sequence="100"
                UseShortId="true" />

Now, you should have the Sign in as different user option.

2
  • Normal disclaimer: As always, modifying out of the box controls ain't supported and your changes could be overwritten by a future service pack. This works best for development and evaluation environments.
    – James Love
    Commented Sep 22, 2013 at 18:26
  • Yes. is very important what @JamesLove says. You should create a custom control template and extend the ootb ribbon. Commented Sep 23, 2013 at 7:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.