Total Pageviews

21 Nov 2012

Creating Feature with Documents Library, Folders and Documents it It

Task

Create a SharePoint 2010 feature that does the following:
  • Creates a library instance 
  • Adds several folders to this library
  • Adds some images to the folders

Prerequisites

  • SharePoint 2010
  • Visual Studio 2012
 

Easy Guide

1. Create the list based on Document Library 

 
 
 
 
2. Remove unneeded content types or fields from Schema.xml. You can leave it as it is!
 
 

 
3. Add image file to the list instance. Set Deployment Type to "ElementFile".

 
4. Open Elements.xml.
a. To create folders and subfolders in your document library add <Module> tags as shown below.
Lists/Banners - is our document library URL.
BigBanner - is our folder name
b. To add documents to the folders in your document library add <Module> with <File> tag in it.
 
 

Results

 
 
 
 

Other good examples

Adding Documents in document library with feature

 
Deploying a custom master page in SharePoint 2010



No comments:

Post a Comment