Question

I have following web part which I copied from this blog

<?xml version="1.0" encoding="utf-8"?>
 <Elements xmlns="http://schemas.microsoft.com/sharepoint/">  
  <Module Name="XYZCustomPages" RootWebOnly="True">    
    <File Path="XYZCustomPages\Home.aspx" Url="Home.aspx" IgnoreIfAlreadyExists="true">      
      <View List="Lists/Tasks" BaseViewID="0" WebPartZoneID="Left" WebPartOrder="100">
        <![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>My Tasks</Title>
         </WebPart>
       ]]>
     </View>
  </File>  
 </Module>

Now I want same code for SharePoint 2013. Please help me

Was it helpful?

Solution

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="Pages">
       <File Path="Pages\Tasks.aspx" Url="Pages/Tasks.aspx" ReplaceContent="TRUE">
      <View List="Lists/WorkflowTaskList" BaseViewID="5" WebPartZoneID="TaskListZone" 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="InplaceSearchEnabled" type="bool">False</property>
                          <property name="ShowToolbarWithRibbon" type="bool">False</property>
                      </properties>
                  </data>
              </webPart>
          </webParts>
      ]]>
      </View>
    </File>
  </Module>
</Elements>
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top