1

I have provisioned a publishing page through a feature and andded an instance of a discussion board web part to the home page, this works fine. How can I make sure the web part chrome is set to TitleOnly?

<View List="Lists/Discussion" BaseViewID="3" WebPartZoneID="WebPartZone2" DisplayName="Discussion"/>

I have a document Library and it works fine but privioning the discussion board the same way results in a unknown error

<View List="Documents" BaseViewID="1" WebPartZoneID="WebPartZone1">
     <![CDATA[
          <webParts>
              <webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
                  <metaData>
                      <type name="Microsoft.SharePoint.WebPartPages.XsltListViewWebPart,Microsoft.SharePoint,Version=15.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" />
                      <importErrorMessage>Cannot import this Web Part.</importErrorMessage>
                  </metaData>
                  <data>
                      <properties>
                          <property name="Title" type="string">Documents</property>
                          <property name="DisableViewSelectorMenu" type="bool">True</property>
                          <property name="InplaceSearchEnabled" type="bool">False</property>
                          <property name="ShowToolbarWithRibbon" type="bool">False</property>
                          <property name="ChromeType" type="chrometype">TitleOnly</property>
                      </properties>
                  </data>
              </webPart>
          </webParts>
      ]]>
   </View>
1

When provisioning Discussion Board it is required to specify ContentTypeID attribute for View element as demonstrated below:

<View List="Lists/Discussion" 
      BaseViewID="3" 
      WebPartZoneID="WebPartZone2" 
      DisplayName="Discussion" 
      ContentTypeID="0x012001" />

where ContentTypeID value is set to 0x012001 (RootOfList)

0

My code was actually working correctly my issue ended up being that my pages were being provisioned before my list was actually available.

The pages were in a separate module that was being deployed as a feature which was included in a custom site definition, the solution was to move the pages into the same module as the site definition and deploy the pages withing the module element of the site definition onet.xml.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.