Today when I was working on a requirement, I had the need to create a customized picture library. To create this picture library the required List Schema, Definition, Instance Template, etc. were created.
One challenge I had at the end was, that this Library had to be pre-populated with a folder to store some control files.
Here is how it was resolved:
Note: I will not explain how the list definition and schema were created as there are several posts out there to help.
In the List Instance definition (manifest file), you just have to add the line shown below (Module.. Path..):
1: <?xml version="1.0" encoding="utf-8" ?>
2: <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
4: <ListInstance FeatureId="327B763B-A5E7-4ac2-8458-B6570D362C0B"
10: OnQuickLaunch="FALSE" />
11: <!-- Adding a folder to the list instance-->
12: <Module Path="ControlFiles" Url="WattsUpImagesLibrary/ControlFiles" />
Please take a special note of the URL attribute, the value “WattsUpImagesLibrary” is the one used above as URL of the instance.
The output as a result of this:
IMPORTANT: To be able to create folder in Document Library, your list need to have the content reference of “0x0120” OR a custom one derived from it in the format of 0x0120 + 00 + <Guid>