April 3, 2007

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>

3 comments:

Anonymous said...

How do we create sub folders inside a folder in onet.xml?

JOJO said...
This comment has been removed by the author.
JOJO said...

Rows
Row
Field Name='FSObjType'1 _Field
Field Name='Title' folder title _Field
Field Name='BaseName'folderb _Field
_Row

Row
Field Name='FSObjType'1 _Field
Field Name='Title'subfolder title _Field
Field Name='BaseName'folderb/subfolders _Field
_Row
_Rows