C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\1033\ directory (1033 is the locale ID for English - so if you have a Portal in another language you will another number). In this directory you will find a number of directory which contain all the templates for different site and area types. For a nice overview check out Heathers blog - SharePoint site definitions - Mapping files to pages on a SharePoint sites
One of the interesting files you will find in these directories is onet.xml - this file contains the bigger part of how your site/area will look like - common customizations for this file are
The last option was something I wanted to try - including webparts when a site is instantiated. Basically I wanted all of the "My sites" to contain an extra webpart on the private side.
Steps I took:
The last step is modifying onet.xml for My Site (located in the C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\1033\SPSMSITE\XML directory) - in this XML file you will find a Modules element and inside the Modules element the AllUsersWebPart element. So if you want that a webpart is added to a site/area by default you can add an extra AllUsersWebPart element
for your custom webpart. See example
<AllUsersWebPart WebPartZoneID="MiddleRightZone" WebPartOrder="4"><![CDATA[<WebPart
xmlns="http://schemas.microsoft.com/WebPart/v2"><Assembly>RecentDocsWebPart,
Version=1.0.0.1, Culture=neutral, PublicKeyToken=7f713d9ae1e786b0</Assembly><TypeName>RecentDocsWebPart.RecentDocsWebPart</TypeName><Title>Recent
Documents Enhanced</Title><Description>Demo</Description><PartOrder>4</PartOrder><FrameType>TitleBarOnly</FrameType><AllowRemove>true</AllowRemove><AllowMinimize>true</AllowMinimize><IsVisible>true</IsVisible></WebPart>]]></AllUsersWebPart>
This may look fairly complex, but is actually fairly easy:
Unfortunately, this didn't work for the "My Site" so I tried it for the "Community Area" template and it didn't work for existing areas but only for newly created areas. Unfortunately this doesn't even work for the "My Site", even when users access your portal for whom the "My Site" still needs to be generated. I guess it will be the easiest to just open the "My Site" in FrontPage 2003 and add the webpart this way or create code which will add the webpart from code... I guess some people will call this YASQ, Yet Another SharePoint Quirk,....
2 comments:
I just opened my "My Site" and switched into "Shared View" in IE. Then you can add Web Parts which will show up for all people. No FrontPage required at all...
Unfortunately, I wanted to add a webpart to the private side.
Post a Comment