Sharepoint 2013 Task List Different Views in in custom page layout.
Use the below snippet to show different sharepoint 2013 task list views using custom page layout.
All Tasks
<View List="Lists/TaskListName" BaseViewID="1" WebPartZoneID="MainTopZone" WebPartOrder="1">
<![CDATA[
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="Microsoft.SharePoint.WebPartPages.XsltListViewWebPart,Microsoft.SharePoint,
Version=14.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="Title" type="string">All Tasks</property>
<property name="DisableViewSelectorMenu" type="bool">False</property>
<property name="InplaceSearchEnabled" type="bool">True</property>
<property name="ShowToolbarWithRibbon" type="bool">True</property>
</properties>
</data>
</webPart>
</webParts>
]]>
</View>
Gantt Chart
<View List="Lists/TaskListName" BaseViewID="8" Type="GANTT" WebPartZoneID="MainTopZone" WebPartOrder="1">
<![CDATA[
<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
<Assembly>Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
<TypeName>Microsoft.SharePoint.WebPartPages.ListViewWebPart</TypeName>
<Title>Gantt view</Title>
</WebPart>
]]>
</View>
Completed Tasks
<View List="Lists/TaskListName" BaseViewID="4" WebPartZoneID="MainTopZone" WebPartOrder="1">
<![CDATA[
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="Microsoft.SharePoint.WebPartPages.XsltListViewWebPart,Microsoft.SharePoint,
Version=14.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="Title" type="string">Gantt Chart</property>
<property name="DisableViewSelectorMenu" type="bool">False</property>
<property name="InplaceSearchEnabled" type="bool">True</property>
<property name="ShowToolbarWithRibbon" type="bool">True</property>
</properties>
</data>
</webPart>
</webParts>
]]>
</View>
MY Tasks
<View List="Lists/TaskListName" BaseViewID="5" WebPartZoneID="MainTopZone" WebPartOrder="1">
<![CDATA[
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="Microsoft.SharePoint.WebPartPages.XsltListViewWebPart,Microsoft.SharePoint,
Version=14.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="Title" type="string">My Tasks</property>
<property name="DisableViewSelectorMenu" type="bool">False</property>
<property name="InplaceSearchEnabled" type="bool">True</property>
<property name="ShowToolbarWithRibbon" type="bool">True</property>
</properties>
</data>
</webPart>
</webParts>
]]>
</View>
UpComing Tasks
<View List="Lists/TaskListName" BaseViewID="3" WebPartZoneID="MainTopZone" WebPartOrder="1">
<![CDATA[
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="Microsoft.SharePoint.WebPartPages.XsltListViewWebPart,Microsoft.SharePoint,
Version=14.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="Title" type="string">Upcoming</property>
<property name="DisableViewSelectorMenu" type="bool">False</property>
<property name="InplaceSearchEnabled" type="bool">True</property>
<property name="ShowToolbarWithRibbon" type="bool">True</property>
</properties>
</data>
</webPart>
</webParts>
]]>
</View>
Late Tasks
<View List="Lists/TaskListName" BaseViewID="2" WebPartZoneID="MainTopZone" WebPartOrder="1">
<![CDATA[
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="Microsoft.SharePoint.WebPartPages.XsltListViewWebPart,Microsoft.SharePoint,
Version=14.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="Title" type="string">Late Tasks</property>
<property name="DisableViewSelectorMenu" type="bool">False</property>
<property name="InplaceSearchEnabled" type="bool">True</property>
<property name="ShowToolbarWithRibbon" type="bool">True</property>
</properties>
</data>
</webPart>
</webParts>
]]>
</View>
Calendar View
<View List="Lists/TaskListName" BaseViewID="9" Type="CALENDAR" WebPartZoneID="MainTopZone" WebPartOrder="1">
<![CDATA[
<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
<Assembly>Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
<TypeName>Microsoft.SharePoint.WebPartPages.ListViewWebPart</TypeName>
<Title>Calendar</Title>
</WebPart>
]]>
</View>
All Tasks
<View List="Lists/TaskListName" BaseViewID="1" WebPartZoneID="MainTopZone" WebPartOrder="1">
<![CDATA[
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="Microsoft.SharePoint.WebPartPages.XsltListViewWebPart,Microsoft.SharePoint,
Version=14.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="Title" type="string">All Tasks</property>
<property name="DisableViewSelectorMenu" type="bool">False</property>
<property name="InplaceSearchEnabled" type="bool">True</property>
<property name="ShowToolbarWithRibbon" type="bool">True</property>
</properties>
</data>
</webPart>
</webParts>
]]>
</View>
Gantt Chart
<View List="Lists/TaskListName" BaseViewID="8" Type="GANTT" WebPartZoneID="MainTopZone" WebPartOrder="1">
<![CDATA[
<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
<Assembly>Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
<TypeName>Microsoft.SharePoint.WebPartPages.ListViewWebPart</TypeName>
<Title>Gantt view</Title>
</WebPart>
]]>
</View>
Completed Tasks
<View List="Lists/TaskListName" BaseViewID="4" WebPartZoneID="MainTopZone" WebPartOrder="1">
<![CDATA[
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="Microsoft.SharePoint.WebPartPages.XsltListViewWebPart,Microsoft.SharePoint,
Version=14.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="Title" type="string">Gantt Chart</property>
<property name="DisableViewSelectorMenu" type="bool">False</property>
<property name="InplaceSearchEnabled" type="bool">True</property>
<property name="ShowToolbarWithRibbon" type="bool">True</property>
</properties>
</data>
</webPart>
</webParts>
]]>
</View>
MY Tasks
<View List="Lists/TaskListName" BaseViewID="5" WebPartZoneID="MainTopZone" WebPartOrder="1">
<![CDATA[
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="Microsoft.SharePoint.WebPartPages.XsltListViewWebPart,Microsoft.SharePoint,
Version=14.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="Title" type="string">My Tasks</property>
<property name="DisableViewSelectorMenu" type="bool">False</property>
<property name="InplaceSearchEnabled" type="bool">True</property>
<property name="ShowToolbarWithRibbon" type="bool">True</property>
</properties>
</data>
</webPart>
</webParts>
]]>
</View>
UpComing Tasks
<View List="Lists/TaskListName" BaseViewID="3" WebPartZoneID="MainTopZone" WebPartOrder="1">
<![CDATA[
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="Microsoft.SharePoint.WebPartPages.XsltListViewWebPart,Microsoft.SharePoint,
Version=14.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="Title" type="string">Upcoming</property>
<property name="DisableViewSelectorMenu" type="bool">False</property>
<property name="InplaceSearchEnabled" type="bool">True</property>
<property name="ShowToolbarWithRibbon" type="bool">True</property>
</properties>
</data>
</webPart>
</webParts>
]]>
</View>
Late Tasks
<View List="Lists/TaskListName" BaseViewID="2" WebPartZoneID="MainTopZone" WebPartOrder="1">
<![CDATA[
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="Microsoft.SharePoint.WebPartPages.XsltListViewWebPart,Microsoft.SharePoint,
Version=14.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="Title" type="string">Late Tasks</property>
<property name="DisableViewSelectorMenu" type="bool">False</property>
<property name="InplaceSearchEnabled" type="bool">True</property>
<property name="ShowToolbarWithRibbon" type="bool">True</property>
</properties>
</data>
</webPart>
</webParts>
]]>
</View>
Calendar View
<View List="Lists/TaskListName" BaseViewID="9" Type="CALENDAR" WebPartZoneID="MainTopZone" WebPartOrder="1">
<![CDATA[
<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
<Assembly>Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
<TypeName>Microsoft.SharePoint.WebPartPages.ListViewWebPart</TypeName>
<Title>Calendar</Title>
</WebPart>
]]>
</View>
Comments
Post a Comment