C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\GLOBAL\ application directory with name default.master.
we can open it in Sharepoint designer and customize it to give look and feel. But this is not a recommended approach. If we will modify the default.master, then we will not be able to use default view of mysite anymore as we are customizing the master page from site definition.
An alternate and recommended way to do it is feature stapling. In feature stapling, we can create a custom master page and replace that with default.master at run time using the feature.
The site templates for MySite are-
SPSPERS (private view)- SPSMSITEHOST (public view)
The master page for these two templates need to be replaced with our custom master page. I found a great blog by sridhar to achieve the feature stapling-
http://blogs.msdn.com/sridhara/archive/2007/05/19/customizing-mysite-in-moss-2007.aspx
Using this blog I was able to customize the look and feel of master page.
Now my next task was to add a content editor webpart in default.aspx. The solution for this is a bit tricky. I had to play with ONET.XML to add the webparts.
Here is the steps I followed
1. Open the ONET.XML file from the location - C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\SPSPERS\XML\ using some editor.( dont forget to take a backup of the same.)
2. Find the Modules tag and then
3. Remove all the lines inside
http://schemas.microsoft.com/WebPart/v2< /a>">
]]>
If you dont want to see the other webpart, you can comment or remove them.
4. save and close the ONET.XML
5. Do an IIS reset.
Thats it. Now the default.aspx will display content editor webpart.
Adding custom links
To add custom left links and remove the links coming on the left, do the following-
Open ONET.XML and find 'navbar'
So when we add our custom link, we will have to add them in resource file also.
For this, the entry in the resource file would be-
Name -- category_MySiteHome
value-- Home
Its fine. Now comment the existing
'Home' will be the text appeared on the link.
Adding built-in page for custom links
Now we have created custom link. we would like to have a custom page which will be linked to the custom link we have created.
Create an ASP.Net Application. Add a page home.aspx into the application. In the aspx file, put proper HTML and webpart zone as you want to be on the page. If you are adding a zone then add 'webpartpages:webpartzone' tag instead of 'asp:webpartzone' tag. you may add the additional functionality and events on code behind file. give a strong name to the project and build it.
Now we need a feature which will be used to deploy this page into mysite.
First create feature.xml file. open it in a editor and add the following-
< ?xml version="1.0" encoding="utf-8" ?>
< id="A28CE77C-7E79-49e1-867E-AF4280466BA7" title="custom pages for mysite" description="" xmlns="http://schemas.microsoft.com/sharepoint/" scope="Web" hidden="false" version="1.0.0.0">
<>
< location="element.xml">
< location="home.aspx">
< /elementmanifests>
< /feature>
Now Create element.xml file. Open it in an editor and add the following-
< ?xml version="1.0" encoding="utf-8" ?>
< xmlns="http://schemas.microsoft.com/sharepoint/">
< url="">
< url="home.aspx" name="home.aspx" type="Ghostable">
< /File>
< /Module>
< /Elements>
Now create a folder say- MySitePages. Put feature.xml,element.xml and home.aspx file into it. put this folder in C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\ directory. Take the DLL of your ASP.Net application and put it into GAC.
Now we may use stsadm -o installfeature and stsadm -o activatefeature utility to deploy and activate the feature. we can activate the feature at site level after creating mysite.
After activating the page will be attached to the mySite.
Its done now. :)

This is life saver for me, I was looking a good paper on customizing mysites in sharepoint.
ReplyDeleteThanks for posting.