The comment at the following site suggests that it is not possible to put multiple lists in a feature.
http://msdn.microsoft.com/en-us/library/ms434306.aspx
Which although is correct, as always Microsoft have another method of doing this.
The procedure is relatively straight forward.
- Create list
- Save the list as a template.
- Save the stp file(s)
- create a feature in which the Elements.xml file references the stp.
Create List
This is the normal procedure navigate to the create list screen http://yourserver/_layouts/create.aspx
Select Custom List
In the next screen enter the name of the list and description.
You will then be presented with a standard list, go to List Settings
Add the additional columns you require.
Save List as Template
When finished select Save list as template.
and complete the form shown below.
Save the stp.
If you go to the List templates (http://yourserver/_catalogs/lt/Forms/AllItems.aspx) your will find your custom list by clicking on the name of the file you will be given the option to save the file. Put this file somewhere safe!
At this point to prevent trying to create two templates of the same name, I usually either rename or delete this item.
Create the feature
For this step I use WSPBuilder which can be downloaded from here. I assume that you can create a basic feature using the WSPBuilder Add-in.
You will need a file structure like this.
Then the elements.xml contents will look like this.
The Property Value is the name of the list (News Articles in the example above)
You can nest multiple “Module” elements.
The when you build and deploy the wsp you will have a new feature, which when activated will have additional items in the List templates and in the create list screen.