Features & Event Receivers_Institute IntroductionIntroduction
Features in Microsoft SharePoint Foundation reduce the complexity involved in making simple site customizations, and they are robust when upgrades are applied to a deployment. Features eliminate the need to copy large chunks of code to change simple functionality. Features thus reduce versioning and inconsistency issues that may arise among front-end web servers.
Features make it easier to activate or deactivate functionality in the course of a deployment, and administrators can easily transform the template or definition of a site by simply toggling a particular Feature on or off in the user interface. Features provide the following capabilities:
- Scoping semantics for determining where custom code runs
- Pluggable behavior for installing or uninstalling Features within a deployment
- Pluggable behavior for activating or deactivating Features at a given scope
- A scoped property bag for storing data required by a Feature within its scope
- The basis of a unified framework for distributed deployment of SharePoint Foundation solutions
Ability to upgrade Feature versions
Features are stored on the front-end web server in the %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\FEATURES directory. The Feature subfolder includes a Feature.xml file that defines the base properties of the Feature and the elements bound to it, such as XML files containing element manifests and any other supporting files. A Feature folder can contain a Feature.xml file and any number of supporting element files.
|SharePoint Foundation supports only low-order ASCII characters, and no spaces, for Feature folder and file names.|
Features can be installed and activated using the SharePoint Management Shell, through the object model, or through the stsadm tool. You can also activate a Feature through the user interface. Installing a Feature makes its definition and elements known throughout a server farm, and activating the Feature makes the feature available at a particular scope.
The Feature element is used in a Feature.xml file to define a Feature and to specify the location of assemblies, files, dependencies, or properties that support the Feature. A Feature includes a Feature.xml file and any number of files describing individual elements.
Items that were previously contained within a large site definition file have been broken out as separate elements within Features. An element is an atomic unit within a Feature. A Feature.xml file typically points to one or more XML files whose top-level Elements tag contains definitions for elements that support the Feature. There are several types of elements, such as an event handler, that can be included in a Feature. For specific information about the file format and XML elements used in the Feature.xml file, see Feature.xml Files.
Creating SharePoint Features
You can use a SharePoint Feature to group related SharePoint project items for easier deployment. You can create Features, set scopes, and mark other Features as dependencies by using the SharePoint Feature Designer. The designer also generates a manifest, an XML file that describes each Feature.
Adding Features to the SharePoint Solution
You can add a Feature to the SharePoint solution by using Solution Explorer or the Packaging Explorer. You can use one of the following methods to add a Feature.
- In Solution Explorer, right-click Featuresand then click Add Feature.
- In Packaging Explorer, right-click the package, and then click Add Feature.
At TekSlate, we offer resources that help you in learning various IT courses.
We avail both written material and demo video tutorials.
To gain in-depth knowledge and be on par with practical experience, then explore SharePoint Training Course.
Using the Feature Designer
A SharePoint solution can contain one or more SharePoint Features, which are grouped under the Feature node in Solution Explorer. Each Feature has its own Feature Designer that you can use to customize the Feature properties. For more information, see How to: Customize a SharePoint Feature.
To distinguish Features from one another, you can configure the Feature properties such as the title, description, version, and scope.
Feature Designer Options
After you create a Feature, you can use the Feature Designer to customize it.
The following table describes the Feature properties that are displayed in the Feature Designer.
|Title||Optional. The default title of the Feature is set to SolutionName FeatureName.|
|Description||Optional. The description of the SharePoint Feature.|
|Scope||Required. If a Feature is created by using Solution Explorer, the scope is set to Web by default.OptionDescriptionFarmActivate a Feature for an entire server farm.|
SiteActivate a Feature for all Web sites in a site collection.
WebActivate a Feature for a specific Web site.
WebApplicationActivate a Feature for all Web sites in a Web application.
|Items in the Solution||All SharePoint Items that can be added to the Feature.|
|Items in the Feature||The SharePoint project items that have been added to the Feature.|
Adding and Removing SharePoint Project Items
You can select which SharePoint project items that you want to add a SharePoint Feature to for deployment. Use the Feature Designer to add and remove items to Features, and view the Feature manifest.
Adding Feature Dependencies
You can configure the Feature manifest so that the SharePoint server activates certain Features before your Feature is activated. For example, if your SharePoint Feature depends on other Features for functionality or data, the SharePoint server can first try to activate any of the Features that your feature depends on.
For Indepth understanding of SharePoint click on
- SharePoint Tutorials
- Introduction to SharePoint
- Application Pages
- SharePoint Security
- Introduction to Web Parts
- Microsoft Flow Training In Dallas