Sladescross's Blog

Blogging about Sharepoint related stuff

Branding Sharepoint 2010 MySite July 3, 2010

Filed under: Branding,MySite — sladescross @ 4:15 pm

http://blogs.msdn.com/b/spsocial/archive/2010/03/30/customizing-my-sites-in-microsoft-sharepoint-2010.aspx

•Customizing the Look and Feel
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:
<Feature Id="”
Title=”My Feature”
Description=”New Nav Feature”
Version=”1.0.0.0″
Hidden=”TRUE”
Scope=”Web”
xmlns=”http://schemas.microsoft.com/sharepoint/”&gt;

Example elements.xml:

3. 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.

4. 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}

About these ads
 

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

 
Follow

Get every new post delivered to your Inbox.

Join 63 other followers