Creating custom my site template
Anatoly Mironov
Here are some links to start creating a custom my site template:
If you want to take the default templates take a look at **{SharepointRoot}\TEMPLATE\SiteTempates\SPMSITE **(the site template for “my content” - an individual site collection rootweb template, and first of all {SharepointRoot}\TEMPLATE\SiteTempates\SPMSITEHOST, the host site template for my sites. They include pages and onet.xml. Both use mysite.master which can be found at:
- {SharepointRoot}\TEMPLATE\FEATURES\MySiteLayouts\mysite.master
- {SharepointRoot}\TEMPLATE\FEATURES\PersonalizationSite\mysite.master
If you compare so you will see that they are identical, so I would like to know why there are two same files in different locations. MySite has actually two ribbons. The second, with additional links (my content, newsfeed…), is defined by:
<SharePoint:DelegateControl
runat="server"
ControlId="GlobalNavigation"/>If you want to remove some links, remove the corresponding controls, such as:
<SPSWC:EditProfileButton
runat="server"
id="ddlEditProfile"/>While creating a custom my site template I discovered many useful controls from Sharepoint WebControls namespace (often shortened as SPWC in xml namespace). Here is an example how we can get a string value from a localized resource:
<SPSWC:StringValueEx ResourceFile="spscore" LocId="SkipContactCard_Text" runat="server" />Or this one:
<SPSWC:ProfilePropertyImage
PropertyName="PictureUrl"
RenderWrapTable="False"
ShowPlaceholder="true"
id="PictureUrlImage"
ImageSize="Large"
CenterVertically="true"
runat="server"/>Using profile controls outside My Site
These web controls can be used outside my site, actually in any other page. But don’t forget to add ProfilePropertyLoader:
<SPSWC:ProfilePropertyLoader
id="m_objLoader"
LoadFullProfileOfCurrentUser="true"
runat="server" />
<SPSWC:EditProfileButton
runat="server"
id="ddlEditProfile" />If there is no ProfilePropertyLoader, other controls won’t show up. So if you ask yourself: “OMG, I added EditProfileButton, but it doesn’t appear!” Well, just add ProfilePropertyLoader.