A List Template of Your Very Own
To create your own list template using a feature is pretty easy. The only difficult part is trying to understand the documentation on the MSDN about which attributes are required and which are optional. When it comes to my experience with features and list templates, I have found that all of the attributes should be required, otherwise Sharepoint will place something in there for you and in our case this destroyed the out of the box templates on our Sharepoint site.
The first step is to create the Feature.xml file with a name for your feature and the location of the Elements.xml file.
<feature title="Simple List Feature" id="GUID" scope="Web" xmlns="http://schemas.microsoft.com/sharepoint/">
<elementmanifests>
<elementmanifest location="Elements.xml">
</elementmanifests>
</feature>
After that you can create the Elements.xml file and place the ListTemplate node in there.
<elements>
<listtemplate name="SimpleList" displayname="Simple List" type="20" description="This is my simple list." basetype="0" onquicklaunch="FALSE" securitybits="11">
</elements>
The ListTemplate tag is pretty simple. You give it a name and a display name. The display name shows up in the site settings area for list templates. The description field is used to provide more information about your list template. The basetype is the default schema for the lists created from this template. Most times this will be 0. The onquicklaunch allows the list template to show up on the quick launch bar. The security bits allows for read, write, and schema design security.
There are many other fields that you can use in the list template to customize it the way you want. The resource below lists all of these fields.
<edit>
It has been brought to my attention that I forgot to mention the schema.xml file. At the time that this post was originally written, we copied a schema.xml file from an existing list and then modified it. Microsoft recommends this approach as building the schema file from hand is time consuming and very prone to errors. There are also tools out there that will generate schema files from a list that you build using the UI.
</edit>
http://msdn2.microsoft.com/en-us/library/ms462947.aspx
Labels: features, list templates, MOSS, Sharepoint lists, Sharepoint Server 2007
2 Comments:
You've failed to include the schema.xml part, there is more to this topic than you give it credit for
The schema.xml file is usually copied from an existing list template in the 12 hive and then modified with the fields you want added or removed.
Post a Comment
Subscribe to Post Comments [Atom]
<< Home