Let's start at the beginning.....
To create a feature you first need to define the Feature.xml file. Here is a sample file:
<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/"
Id="1C552111-5D53-440d-8E6E-50E3B5EB5492"
Title="LFI View Photo Page"
Description="Creates the view photo page."
Scope="Web"
Hidden="false">
<elementmanifests>
<elementmanifest location="Elements.xml">
</elementmanifests>
</feature>
The main areas of this file are the feature node. Here you need to give the feature a unique ID (GUID). You can accomplish this by opening Visual Studio 2005 and clicking on tools. Then select create GUID. While working with feature files, I have noticed that some attributes require the curly braces around the GUID and some don't. You may have to follow the feature documentation to figure this out. The MSDN has good definitions of the elements and the attributes for the elements.
http://msdn2.microsoft.com/en-us/library/ms439657.aspx
The other attributes of the feature element are mostly for your own benefit. The title and description will show up in either the site features or site collection features list. The scope determines where the feature will be installed. For most situations this will be "Web" if you want to deploy the feature to the entire site collection or "Site" if you want it available to the subsites. The hidden attribute determines if the feature will show up in the feature list. If you want to be able to see the feature to activate it, you need to set this to false.
The ElemenetManifests element contains an ElementManifest element that has one attribute, Location. This attribute tells the feature where to look for the rest of the information to activate the feature. In the next post I will begin looking at the Elements.xml file. You can name this file whatever you want, but I find having a convention like naming them all Elements.xml keeps things neat.
Labels: Feature.xml, features, MOSS
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home