Friday, 21 October 2011

Add and Deploy files (Css,js,Images) in 12 Hive - SharePoint solution package


There are various Options to deploy a file such as CSS, Js or an Image file in 12 hive using your solution Package

Option 1 - Using the Template item in your Soltuion project
Adding Template creates a TEMPLATE folder like structure which exists in 12 hive. Once you add a new Templates item in your empty project, a Templates folder is created in your project along with a text file called TempleFile.txt. you can delete the "TemplateFile.txt" file and create the Layouts folders structure if you want to deploy your file in the Layouts folder. Finally, add your files in the Layouts folder that you want to deploy.


Option 2 - Using <rootfiles> tag.
<rootfiles> tag is added in your manifest.xml to include the files being added in the solution. Create two folders Images and JsFiles in your solution
and add files into it. Then add the below in your manifest.xml
For e.g.
<rootfiles>
<rootfile location="TEMPLATE\LAYOUTS\IMAGES\img1.jpg">
<rootfile location="TEMPLATE\LAYOUTS\JsFiles\toggle.js">
</rootfile>
Next add an entry in the ddf file. See example below
.Set DestinationDir=TEMPLATE\LAYOUTS\IMAGES
images\img1.jpg
JsFiles\toggle.js

Ads by Google

No comments:

Post a Comment