Like many other SharePoint users, I've had to create a custom list definition. After much trouble, I've managed to create one (I think, let me get through all the errors first), but is there a "basic" schema out there I can start with, or a purpose built editor for Schema.xml
generation?
To create custom list definition I always use some built in list definition as template.
Create new feature then copy schema.xml (maybe some other files also if present) from existing feature and modify schema.xml file directly with some text editor. I don’t have tried any custom editor for that and always get work done with copy-paste and changing attributes values.
Built in list definitions are located in 12 hive as features:
My recommendation, and what will bring you the closest to a final version, is to use the SharePoint web interface, set up your list as you want it, including views, custom columns, etc. Then, save the list as a template.
The .stp file you get is basically just a .cab file with a funny name. Rename to cab and extract the manifest, which will include a nearly ready-to-use schema.xml file for you to use.
What you need to change is the path or setuppath of the list forms. You will find these at the bottom of the manifest.xml file. These forms, if you use the default SharePoint lists, can be set to SetupPath="pages/form.aspx". Here is an example from the custom list forms element:
<Form Type="DisplayForm" Url="DispForm.aspx"
SetupPath="pages\form.aspx" WebPartZoneID="Main" />
<Form Type="EditForm" Url="EditForm.aspx"
SetupPath="pages\form.aspx" WebPartZoneID="Main" />
<Form Type="NewForm" Url="NewForm.aspx"
SetupPath="pages\form.aspx" WebPartZoneID="Main" />
You also need to update the View path for every view, which should be SetupPath="pages/viewpage.aspx" if using the default forms in your original site.
Note that you need to modify other attributes as well, but if you make sure to follow the wss.xsd schema and that your custom list schema.xml validates to the wss.xsd schema you should be ok.
.b
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With