Showing posts with label onet.xml. Show all posts
Showing posts with label onet.xml. Show all posts

May 16, 2007

MOSS: This page is not using a valid page layout.

Problem:
When creating a custom Site Definition containing Publishing features, the site creation succeeds, but when entering the site you receive error: "This page is not using a valid page layout. To correct the problem, edit page settings and select a valid page layout.""

Solution:
See that you have Type set in the File element under Modules -> Module in the ONET.XML of the Site Definition.
<File Url="default.aspx" NavBarHome="True" Type="GhostableInLibrary" Level="Draft">

April 18, 2007

MOSS: Discussion Board links point to default.aspx when creating List Views in site definition

Problem:
When defining Discussion Boards in Site Definition (in ONET.XML), the subjects of discussion threads point to default.aspx. This means that when clicking on a discussion subject the user is redirected back to the same page. Subject links should point to flat.aspx.

Thoughts:
Some blogs (1, 2) mention a KB article related to this problem and also a MS hotfix that might fix this problem, but it doesn't.

Solution:
Add ContentTypeID="0x012001" into the View element of the Discussion web part in your site definition like this:

<View list="Discussion" baseviewid="0" ContentTypeID="0x012001" webpartzoneid="LeftBottom" webpartorder="1"/>

ContentTypeID is now allowed there according to the schema, but it will still fix the issue.

April 16, 2007

MOSS: Setting list view title in ONET.XML

Problem:
Title of a list view (ListViewWebPart) cannot be defined in ONET.XML so it cannot be set different from the title of the list it is showing.

If I modify the title with a browser (Modify Shared Web Part / Appearance / Title) and save the site as a template the new title is nowhere in the .stp file, still if I use that template to create a site the changes are there.

Solution:
Use the WebPart tag and define the Title under it. In the following example a minimized List View Web Part is added with a title My custom title.

<View List="Documents" BaseViewID="11"
WebPartZoneID="Left" WebPartOrder="3" Scope="Recursive">
<![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>My custom title</Title>
<FrameState>Minimized</FrameState>
</WebPart>
]]>
</View>

April 3, 2007

MOSS: Unable to sort folders by ID if folders are created in ONET.XML

Problem:
Unable to sort custom list's folders by ID if folders are created in ONET.XML. Even though the OrderBy is defined correcty in the correct view in the schema.xml of the custom list feature, sorting by ID has no effect.

Solution:
Unknown

MOSS: Creating folders to list in ONET.XML

Problem:
One can easily create items to lists in ONET.XML, but how to create folders?

Solution:
Key is to use ContentTypeId and FSObjType.
<Row>
  <Field Name='ContentTypeId'>0x0120</Field>
  <Field Name='FSObjType'>1</Field>
  <Field Name='Title'>folder title</Field>
  <Field Name='LinkTitle'>folder title</Field>
</Row>