|
2 | 2 | title: Feature Element (Feature)
|
3 | 3 | description: Provides definition, elements and attributes, and a link to an example of how Feature element is used in SharePoint.
|
4 | 4 | manager: soliver
|
5 |
| -ms.date: 06/13/2022 |
| 5 | +ms.date: 06/14/2022 |
6 | 6 | ms.audience: Developer
|
7 | 7 | ms.topic: reference
|
8 | 8 | ms.prod: sharepoint
|
@@ -47,129 +47,26 @@ The following sections describe attributes, child elements, and parent elements.
|
47 | 47 |
|
48 | 48 | ### Attributes
|
49 | 49 |
|
50 |
| -<table> |
51 |
| -<colgroup> |
52 |
| -<col width="20%" /> |
53 |
| -<col width="80%" /> |
54 |
| -</colgroup> |
55 |
| -<thead> |
56 |
| -<tr class="header"> |
57 |
| -<th align="left"><p>Attribute</p></th> |
58 |
| -<th align="left"><p>Description</p></th> |
59 |
| -</tr> |
60 |
| -</thead> |
61 |
| -<tbody> |
62 |
| -<tr class="odd"> |
63 |
| -<td align="left"><p>**ActivateOnDefault**</p></td> |
64 |
| -<td align="left"><p>Optional **Boolean**. **TRUE** if the Feature is activated by default during installation or when a Web application is created; **FALSE** if the Feature is not activated. This attribute equals **TRUE** by default. The **ActivateOnDefault** attribute does not apply to site collection (**Site**) or website (**Web**) scoped Features.</p> |
65 |
| -<p>In general, **Farm**-scoped Features become activated during installation, and when a new Web application is created, all installed **Web application**-scoped Features in it become activated.</p></td> |
66 |
| -</tr> |
67 |
| -<tr class="even"> |
68 |
| -<td align="left"><p>**AlwaysForceInstall**</p></td> |
69 |
| -<td align="left"><p>Optional **Boolean**. **TRUE** if the Feature is installed by force during installation even if the Feature is already installed. For example, if set to **TRUE**, <a href="https://msdn.microsoft.com/library/8d61e0ce-9f47-4320-aa19-7043e5dccedb(Office.15).aspx">Feature deployment event handlers</a> will always fire anytime a user tries to install the Feature (even if it is already installed) by using either the **scanforfeatures** or **installfeature** command-line operation. This attribute equals **FALSE** by default. The **AlwaysForceInstall** attribute affects Features of all scopes.</p></td> |
70 |
| -</tr> |
71 |
| -<tr class="odd"> |
72 |
| -<td align="left"><p>**AutoActivateInCentralAdmin**</p></td> |
73 |
| -<td align="left"><p>Optional **Boolean**. **TRUE** if the Feature is activated by default in the Administrative website, site collection, or Web application. This attribute equals **FALSE** by default. The **AutoActivateInCentralAdmin** attribute does not apply to **Farm**-scoped Features.</p></td> |
74 |
| -</tr> |
75 |
| -<tr class="even"> |
76 |
| -<td align="left"><p>**Creator**</p></td> |
77 |
| -<td align="left"><p>Optional **Text**.</p></td> |
78 |
| -</tr> |
79 |
| -<tr class="odd"> |
80 |
| -<td align="left"><p>**DefaultResourceFile**</p></td> |
81 |
| -<td align="left"><p>Optional **Text**. Indicates a common resource file for retrieving Feature XML resources. If you do not specify a resource in the file, SharePoint Foundation looks by default in %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\TEMPLATES\FEATURES\*FeatureName*\Resources\Resources._Culture_.resx.</p> |
82 |
| -<p>However, if you want to provide a shared core resource file for all the Features in your application, you can specify an alternate file through which to access resources by using **DefaultResourceFile**. For example, if you set **DefaultResourceFile**="_MyFile_", SharePoint Foundation looks in %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\Resources\*MyFile*._Culture_.resx to retrieve localized resources for your Feature.</p></td> |
83 |
| -</tr> |
84 |
| -<tr class="even"> |
85 |
| -<td align="left"><p>**Description**</p></td> |
86 |
| -<td align="left"><p>Optional **String**. Returns a longer representation of what the Feature does.</p></td> |
87 |
| -</tr> |
88 |
| -<tr class="odd"> |
89 |
| -<td align="left"><p>**Hidden**</p></td> |
90 |
| -<td align="left"><p>Optional **Boolean**. This attribute equals **FALSE** by default.</p></td> |
91 |
| -</tr> |
92 |
| -<tr class="even"> |
93 |
| -<td align="left"><p>**Id**</p></td> |
94 |
| -<td align="left"><p>Required **Text**. Contains the globally unique identifier (GUID) for the Feature.</p></td> |
95 |
| -</tr> |
96 |
| -<tr class="odd"> |
97 |
| -<td align="left"><p>**ImageUrl**</p></td> |
98 |
| -<td align="left"><p>Optional **Text**. Contains a URL relative to the \_layouts/IMAGES directory for an image to use to represent the Feature in the user interface (UI).</p></td> |
99 |
| -</tr> |
100 |
| -<tr class="even"> |
101 |
| -<td align="left"><p>**ImageUrlAltText**</p></td> |
102 |
| -<td align="left"><p>Optional **Text**. Contains the alternate text for the image that represents the Feature.</p></td> |
103 |
| -</tr> |
104 |
| -<tr class="odd"> |
105 |
| -<td align="left"><p>**ReceiverAssembly**</p></td> |
106 |
| -<td align="left"><p>Optional **Text**. If set along with **ReceiverClass**, specifies the strong name of the signed assembly located in the global assembly cache from which to load a receiver to handle Feature events.</p></td> |
107 |
| -</tr> |
108 |
| -<tr class="even"> |
109 |
| -<td align="left"><p>**ReceiverClass**</p></td> |
110 |
| -<td align="left"><p>Optional **Text**. If set along with **ReceiverAssembly**, specifies the class that implements the Feature event processor.</p></td> |
111 |
| -</tr> |
112 |
| -<tr class="odd"> |
113 |
| -<td align="left"><p>**RequireResources**</p></td> |
114 |
| -<td align="left"><p>Optional **Boolean**. **TRUE** to specify that SharePoint Foundation check whether resources exist for the Feature by verifying that the standard "sentinel" resource for the Feature is present for a particular culture.</p> |
115 |
| -The resource file is named according to the format `\\\Resources\\\Resources..resx`, where `` is the name that identifies the culture. SharePoint Foundation supports the following formats for culture names: |
116 |
| -<p>`ll-CC`</p> |
117 |
| -<p>`ll-Ssss-CC`</p><br/> |
118 |
| -<p>**Culture name examples:**</p> |
119 |
| -<p>**en-US** English (United States)</p> |
120 |
| -<p>**de-DE** German (Germany)f</p> |
121 |
| -<p>**fr-FR** French (France)</p> |
122 |
| -<p>**ja-JP** Japanese (Japan)</p> |
123 |
| -<p>**sr-Latn-CS** Serbian (Latin, Serbia)</p> |
124 |
| -<p>The Internet Engineering Task Force (IETF) language tag format is `ll(l)-Ssss-CC`, where:</p> |
125 |
| -<ul> |
126 |
| -<li><p>`ll(l)` denotes the required two-letter language identifier (or three-letter if there is no ISO two-letter code for the language).</p></li> |
127 |
| -<li><p>`Ssss` denotes an optional script identifier.</p></li> |
128 |
| -<li><p>`CC` denotes an optional region identifier.</p></li> |
129 |
| -</ul> |
130 |
| -<p></p> |
131 |
| -<p>The **RequireResources** attribute allows you to constrict the visibility of certain Features depending on whether resources exist in a particular language for the Feature.</p> |
132 |
| -<p>**Note**: SharePoint Foundation does not use the file specified by the **DefaultResourceFile** attribute, if there is one, as a backup file for verifying support of a particular language for a feature.</p> |
133 |
| -<p>If the file is not present for the language of a particular website or site collection, then two behaviors can occur:</p> |
134 |
| -<ul> |
135 |
| -<li><p>The Feature will be hidden from the user interface for activation of Features in the website or site collection if the corresponding resources for the language are not available.</p> |
136 |
| -<p>Keep in mind that the **RequireResources** attribute is enforced in the user interface only. A Feature without resources for a particular language can still be activated for a website through command line operations with stsadm.exe or through the object model.</p> |
137 |
| -<p>SharePoint Foundation does not enforce **RequireResources** for Features that are part of a larger site definition. If you supply, for example, a Thai version of a site definition by putting a webtempThai.xml in %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\TEMPLATE\1054\XML, you must verify that each Feature contained in the folder has the appropriate resources.</p></li><br/> |
138 |
| -<li><p>In general, SharePoint Foundation ensures that user interface extension components of the Feature do not show up in websites that do not have resources, but there are exceptions. Even if you do a careful job of setting **RequireResources** and not deploying site definitions unless all Features have resources in them, Features can still show up in sites where resources are not available.</p> |
139 |
| -<p>As an example scenario, assume that you have a custom Feature with resources for two languages that provides custom toolbar buttons and site settings links, and that you have provisioned a new site collection with a root website in one of the languages. Then, after downloading and installing the language pack for a third language, you provision a new subsite in this third language under the original root website. If **RequireResources** is not set to **TRUE**, the custom Feature will attempt to fall back and use fallback resources (in other words, those defined as `Resources\Resources.resx`, with no culture.) If there are no fallback resources, SharePoint Foundation will render empty strings. However, if **RequireResources** is set to **TRUE**, user interface extension components of the Feature (for example, those defined through a <a href="customaction-element.md">CustomAction</a>, <a href="listtemplate-element-list-template.md">ListTemplate</a>, or <a href="featuresitetemplateassociation-element-featuresitetemplateassociation.md">FeatureSiteTemplateAssociation</a> element) will not show up in subsites if no resources are available, so that the custom links and site settings will be automatically hidden.</p></li> |
140 |
| -</ul> |
141 |
| -<p>Setting this attribute only applies to activating Features through the user interface, and not through STSADM.EXE command-line operations or the object model.</p></td> |
142 |
| -</tr> |
143 |
| -<tr class="even"> |
144 |
| -<td align="left"><p>**Scope**</p></td> |
145 |
| -<td align="left"><p>Required **Text**. Specifies the scope in which the Feature can be activated and contains one of the following values: **Farm** (farm), **WebApplication** (Web application), **Site** (site collection), **Web** (website). For information about scope, see <a href="https://msdn.microsoft.com/library/d7f65b00-9a6f-4614-bca7-b1dbb43e3d16(Office.15).aspx">Element Scope</a>.</p></td> |
146 |
| -</tr> |
147 |
| -<tr class="odd"> |
148 |
| -<td align="left"><p>**SolutionId**</p></td> |
149 |
| -<td align="left"><p>Optional **Text**. Specifies the solution to which the Feature belongs.</p></td> |
150 |
| -</tr> |
151 |
| -<tr class="even"> |
152 |
| -<td align="left"><p>**Title**</p></td> |
153 |
| -<td align="left"><p>Optional **Text**. Returns the title of the Feature. Limited to 255 characters.</p></td> |
154 |
| -</tr> |
155 |
| -<tr class="odd"> |
156 |
| -<td align="left"><p>**UIVersion**</p></td> |
157 |
| -<td align="left"><p>Optional **Text**. Specifies the user interface (UI) version for this Feature. UIVersion is specified in multiple ways.</p> |
158 |
| -<ul> |
159 |
| -<li><p>`=#` - the site's UIVersion must be equal to `#`.</p></li> |
160 |
| -<li><p>`<#` - the site's UIVersion must be less than `#`.</p></li> |
161 |
| -<li><p>`>#` - the site's UIVersion must be greater than `#`.</p></li> |
162 |
| -<li><p>`<=#` - the site's UIVersion must be less than or equal to `#`.</p></li> |
163 |
| -<li><p>`>=#` - the site's UIVersion must be greater than or equal to `#`.</p></li> |
164 |
| -<li><p>`#;#` - the site's UIVersion must be in the semicolon-delimited list of numbers.</p></li> |
165 |
| -</ul></td> |
166 |
| -</tr> |
167 |
| -<tr class="even"> |
168 |
| -<td align="left"><p>**Version**</p></td> |
169 |
| -<td align="left"><p>Optional **Text**. Specifies a **System.Version**-compliant representation of the version of a Feature. This can be up to four numbers delimited by decimals that represent a version.</p></td> |
170 |
| -</tr> |
171 |
| -</tbody> |
172 |
| -</table> |
| 50 | +| Attribute | Description | |
| 51 | +| --- | --- | |
| 52 | +| **ActivateOnDefault** | Optional **Boolean**. **TRUE** if the Feature is activated by default during installation or when a Web application is created; **FALSE** if the Feature is not activated. This attribute equals **TRUE** by default. The **ActivateOnDefault** attribute does not apply to site collection (**Site**) or website (**Web**) scoped Features.</br></br>In general, **Farm**-scoped Features become activated during installation, and when a new Web application is created, all installed **Web application**-scoped Features in it become activated. | |
| 53 | +| **AlwaysForceInstall** | Optional **Boolean**. **TRUE** if the Feature is installed by force during installation even if the Feature is already installed. For example, if set to **TRUE**, [Feature deployment event handlers](https://msdn.microsoft.com/library/8d61e0ce-9f47-4320-aa19-7043e5dccedb(Office.15).aspx) will always fire anytime a user tries to install the Feature (even if it is already installed) by using either the **scanforfeatures** or **installfeature** command-line operation. This attribute equals **FALSE** by default. The **AlwaysForceInstall** attribute affects Features of all scopes. | |
| 54 | +| **AutoActivateInCentralAdmin** | Optional **Boolean**. **TRUE** if the Feature is activated by default in the Administrative website, site collection, or Web application. This attribute equals **FALSE** by default. The **AutoActivateInCentralAdmin** attribute does not apply to **Farm**-scoped Features. | |
| 55 | +| **Creator** | Optional **Text**. | |
| 56 | +| **DefaultResourceFile** | Optional **Text**. Indicates a common resource file for retrieving Feature XML resources. If you do not specify a resource in the file, SharePoint Foundation looks by default in %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\TEMPLATES\FEATURES\\*FeatureName\*\Resources\Resources.\_Culture\_.resx.</br></br>However, if you want to provide a shared core resource file for all the Features in your application, you can specify an alternate file through which to access resources by using **DefaultResourceFile**. For example, if you set **DefaultResourceFile**="\_MyFile\_", SharePoint Foundation looks in %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\Resources\\\*MyFile\*.\_Culture\_.resx to retrieve localized resources for your Feature. | |
| 57 | +| **Description** | Optional **String**. Returns a longer representation of what the Feature does. | |
| 58 | +| **Hidden** | Optional **Boolean**. This attribute equals **FALSE** by default. | |
| 59 | +| **Id** | Required **Text**. Contains the globally unique identifier (GUID) for the Feature. | |
| 60 | +| **ImageUrl** | Optional **Text**. Contains a URL relative to the \\_layouts/IMAGES directory for an image to use to represent the Feature in the user interface (UI). | |
| 61 | +| **ImageUrlAltText** | Optional **Text**. Contains the alternate text for the image that represents the Feature. | |
| 62 | +| **ReceiverAssembly** | Optional **Text**. If set along with **ReceiverClass**, specifies the strong name of the signed assembly located in the global assembly cache from which to load a receiver to handle Feature events. | |
| 63 | +| **ReceiverClass** | Optional **Text**. If set along with **ReceiverAssembly**, specifies the class that implements the Feature event processor. | |
| 64 | +| **RequireResources** | Optional **Boolean**. **TRUE** to specify that SharePoint Foundation check whether resources exist for the Feature by verifying that the standard "sentinel" resource for the Feature is present for a particular culture.</br></br>The resource file is named according to the format `<Feature Directory>\Resources\Resources..resx`, where `<Culture Name>` is the name that identifies the culture. SharePoint Foundation supports the following formats for culture names:</br></br>`ll-CC`</br></br>`ll-Ssss-CC`</br></br>**Culture name examples:**</br></br>**en-US** English (United States)</br></br>**de-DE** German (Germany)</br></br>**fr-FR** French (France)</br></br>**ja-JP** Japanese (Japan)</br></br>**sr-Latn-CS** Serbian (Latin, Serbia)</br></br>The Internet Engineering Task Force (IETF) language tag format is `ll(l)-Ssss-CC`, where:</br></br>\* `ll(l)` denotes the required two-letter language identifier (or three-letter if there is no ISO two-letter code for the language).</br>\* `Ssss` denotes an optional script identifier.</br>\* `CC` denotes an optional region identifier.</br></br>The **RequireResources** attribute allows you to constrict the visibility of certain Features depending on whether resources exist in a particular language for the Feature.</br></br>**Note**: SharePoint Foundation does not use the file specified by the **DefaultResourceFile** attribute, if there is one, as a backup file for verifying support of a particular language for a feature.</br></br>If the file is not present for the language of a particular website or site collection, then two behaviors can occur:</br></br>* The Feature will be hidden from the user interface for activation of Features in the website or site collection if the corresponding resources for the language are not available.</br></br> Keep in mind that the **RequireResources** attribute is enforced in the user interface only. A Feature without resources for a particular language can still be activated for a website through command line operations with stsadm.exe or through the object model.</br></br>SharePoint Foundation does not enforce **RequireResources** for Features that are part of a larger site definition. If you supply, for example, a Thai version of a site definition by putting a webtempThai.xml in %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\TEMPLATE\1054\XML, you must verify that each Feature contained in the folder has the appropriate resources.</br></br>\* In general, SharePoint Foundation ensures that user interface extension components of the Feature do not show up in websites that do not have resources, but there are exceptions. Even if you do a careful job of setting **RequireResources** and not deploying site definitions unless all Features have resources in them, Features can still show up in sites where resources are not available.</br></br>As an example scenario, assume that you have a custom Feature with resources for two languages that provides custom toolbar buttons and site settings links, and that you have provisioned a new site collection with a root website in one of the languages. Then, after downloading and installing the language pack for a third language, you provision a new subsite in this third language under the original root website. If **RequireResources** is not set to **TRUE**, the custom Feature will attempt to fall back and use fallback resources (in other words, those defined as `Resources\Resources.resx`, with no culture.) If there are no fallback resources, SharePoint Foundation will render empty strings. However, if **RequireResources** is set to **TRUE**, user interface extension components of the Feature (for example, those defined through a [CustomAction](customaction-element.md), [ListTemplate](listtemplate-element-list-template.md), or [FeatureSiteTemplateAssociation](featuresitetemplateassociation-element-featuresitetemplateassociation.md) element) will not show up in subsites if no resources are available, so that the custom links and site settings will be automatically hidden.</br> </br>Setting this attribute only applies to activating Features through the user interface, and not through STSADM.EXE command-line operations or the object model. | |
| 65 | +| **Scope** | Required **Text**. Specifies the scope in which the Feature can be activated and contains one of the following values: **Farm** (farm), **WebApplication** (Web application), **Site** (site collection), **Web** (website). For information about scope, see [Element Scope](https://msdn.microsoft.com/library/d7f65b00-9a6f-4614-bca7-b1dbb43e3d16(Office.15).aspx). | |
| 66 | +| **SolutionId** | Optional **Text**. Specifies the solution to which the Feature belongs. | |
| 67 | +| **Title** | Optional **Text**. Returns the title of the Feature. Limited to 255 characters. | |
| 68 | +| **UIVersion** | Optional **Text**. Specifies the user interface (UI) version for this Feature. UIVersion is specified in multiple ways.</br></br>\* `=#` - the site's UIVersion must be equal to `#`.</br>\* `<#` - the site's UIVersion must be less than `#`.</br>\* `>#` - the site's UIVersion must be greater than `#`.</br>\* `<=#` - the site's UIVersion must be less than or equal to `#`.</br>\* `>=#` - the site's UIVersion must be greater than or equal to `#`.</br>\* `#;#` - the site's UIVersion must be in the semicolon-delimited list of numbers. | |
| 69 | +| **Version** | Optional **Text**. Specifies a **System.Version**-compliant representation of the version of a Feature. This can be up to four numbers delimited by decimals that represent a version. | |
173 | 70 |
|
174 | 71 | ### Child elements
|
175 | 72 |
|
|
0 commit comments