Recently, I came across an issue with custom site definition which had to display on the default page the calendar webpart as a calendar view (like the one displayed in the default Team Site).
To create this custom site definition, I reused some code available in the default Team Site site definition ; especially the default.aspx page code (why redo something already done ?)
So, everything was working except for the calendar webpart which was always displayed in a list instead of displayed as a calendar
What I wanted | What I had |
![]() |
![]() |
The view settings for this webpart was reused from the Team Site site definition: <View List="$Resources:core,lists_Folder;/$Resources:core,calendar_Folder;" BaseViewID="0" MobileView="TRUE" RecurrenceRowset="TRUE" WebPartZoneID="Left" WebPartOrder="2" />
As this didn’t worked, I looked for solution and found there is a View settings (in this case, this was BaseViewID=4 – the value 4 is for the calendar view), but this didn’t work neither.
Finally, the solution was little bit more tricky:
<View BaseViewID="2" List="$Resources:core,lists_Folder;/$Resources:core,calendar_Folder;" WebPartZoneID="Left" DefaultView="TRUE" Type="CALENDAR" WebPartOrder="2" >
<![CDATA[
<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
<Assembly>Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
<TypeName>Microsoft.SharePoint.WebPartPages.ListViewWebPart</TypeName>
<Title>Calendar</Title>
</WebPart>]]>
</View>