1

How do I control which items gets shown and which doesn't in the MySite globalnavigation?

Currently there are the standard ones (My Site, My newsfeed, My content, My profile), and I'd like to remove My content as that part of the MySite shouldn't be available for anyone at this point.

2 Answers 2

1

We have a DelegateControl on our masterpages to hold the top navigation control. To customize the global nav area more deeply (for example, change the layout or add/remove some controls), you will need to create a new feature to bind your customized navigation control to this DelegateControl.

  1. Under %Program Files%\Common Files\Microsoft Shared Debug\Web Server Extensions\14\TEMPLATE\FEATURES, create a new folder for your new feature, say MyNewNavFeature.

  2. Under the MyNewNavFeature folder, create a feature.xml file to define a web feature that points to elements.xml, and an elements.xml file that binds the “GlobalNavigation” DelegateControl to a new ascx file (say, newtopnavigation.ascx) under controltemplates. Make sure that the Sequence attribute is set to a value < 100 so that this feature overrides the OOB navigation control.

Example feature.xml: " Title="My Feature" Description="New Nav Feature" Version="1.0.0.0" Hidden="TRUE" Scope="Web" xmlns="http://schemas.microsoft.com/sharepoint/">

Example elements.xml:

  1. Create the newtopnavigation.ascx file under Web Server Extensions\14\TEMPLATE\CONTROLTEMPLATES. You can start with a copy of our out-of-box MySiteTopNavigation.ascx and tweak the styles and controls to suit your need.

  2. Use feature stapling to staple this new feature to SPSPERS and SPSMSITEHOST site templates. You can run the following commands from powershell to install and enable your new feature:

a. Install-SPFeature -path "MyNewNavFeature" b. Enable-SPFeature -identity "MyNewNavFeature" -URL http:// (Enables the new feature on the mysitehost) c. Enable the new feature on all personal sites:

$personalSites = get-spsite | where {$_.RootWeb.WebTemplate -eq "SPSPERS"} foreach ($site in $personalSites) {Enable-SPFeature -Identity "MyNewNavFeature" -Url $site.Url}

1
  • Get an error "unexpected token 'in' in expression or statement." Shows "in <<<< $personalSites" further down in the error.
    – user5949
    Commented Dec 7, 2011 at 21:55
0

Unfortunately that menu cannot be "changed" or "configured". With that said, the MyContent link is a link to the personal site, and that can be removed via permissions. If you change the Manage User Permissions, available in the User Profile Service Application, you can take away user's ability to create a personal site. With this removed, the MyContent link should be removed from the menu for anyone without a MySite or without the ability to create a MySite.

4
  • Would this proceedure only take affect on the MyContent link or will the other links also be affected by it?
    – user2536
    Commented Oct 20, 2011 at 17:52
  • That permission level "Create personal site" only impacts the MyContent link in that menu. The other thing it does is remove the "MySite" action from the user action menu in the upper right of the screen. Commented Oct 20, 2011 at 18:40
  • But what if I want the users to still be able to have that option in the upper right action menu? Is there a way to keep it there or should I create a custom action and attach it to that menu, linking to the MySite?
    – user2536
    Commented Oct 20, 2011 at 19:39
  • I misunderstood. I thought you wanted to remove it because you didn't want the users to have a MyContent site. The alternative would be to replace the control with something else or to use jQuery to hide it. Commented Oct 21, 2011 at 0:43

Your Answer

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