For safari
@media screen and (-webkit-min-device-pixel-ratio:0)
{
}
Ie 7
*
Ie 8:
\0/ !important;
.resx
) files; <?xml version="1.0" encoding="utf-8"?> <root> <resheader name="resmimetype"> <value>text/microsoft-resx</value> </resheader> <resheader name="version"> <value>2.0</value> </resheader> <resheader name="reader"> <value> System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 </value> </resheader> <resheader name="writer"> <value> System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 </value> </resheader> <data name="MyFeatureName" xml:space="preserve"> <value>My Feature Name</value> </data> <data name="MyFieldDisplayName" xml:space="preserve"> <value>My Field Display Name</value> </data> <data name="MyFieldChoice1" xml:space="preserve"> <value>My Choice 1</value> </data> <data name="MyFieldChoice2" xml:space="preserve"> <value>My Choice 2</value> </data> </root>See above an example of a resource (
.resx
) file. The <data>
elements are the ones that hold the localized strings:name
attribute is the key used to retrieve the localized string; <value>
child element is the localized string itself. Resources.resx
. This is the culture neutral resource file (or fall back resource file) which will be used by SharePoint whenever there is no resource file for a specific culture. Resources.[culture].resx
. Some examples: Resources.en-US.resx
(english – United States) Resources.pt-PT.resx
(portuguese – Portugal) Resources.fr-FR.resx
(french – France) Resources.pt-BR.resx
(portuguese – Brazil) C:\…\12\TEMPLATE\FEATURES\MyFeature
, the resource files need to be placed in the folder C:\…\12\TEMPLATE\FEATURES\MyFeature\Resources
.feature.xml
).<?xml version="1.0" encoding="utf-8" ?> <Feature xmlns="http://schemas.microsoft.com/sharepoint/" Id="5DFD12AF-D0AA-4c63-8FB8-C49DB1191083" Title="$Resources:MyFeatureName" Scope="Site" Version="1.0.0.0"> <ElementManifests> <ElementManifest Location="SiteColumns.xml"/> <ElementFile Location="Resources\Resources.resx" /> <ElementFile Location="Resources\Resources.pt-PT.resx" /> <ElementFile Location="Resources\Resources.es-ES.resx" /> </ElementManifests> </Feature>The sample above, shows a feature manifest that uses resources to specify the feature title. As you can see, the value of the
Title
attribute is $Resources:MyFeatureName
. This tells SharePoint that it should check the resource file for the current website’s culture and retrieve the string that has the key MyFeatureName
.<ElementFile>
elements to reference the resource files in the feature. This is required if you are deploying this feature through a solution package (.wsp
).DefaultResourceFile
attribute on the <Feature>
element. If you do, SharePoint will not look for resource files in the local Resources
folder for this feature.<?xml version="1.0" encoding="utf-8" ?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <Field Type="Choice" DisplayName="$Resources:MyFieldDisplayName" Required="FALSE" Format="Dropdown" FillInChoice="FALSE" ID="{485b2176-4cfc-4923-8085-c003b85dab36}" StaticName="MyField" Name="MyField"> <Default>$Resources:MyFieldChoice1</Default> <CHOICES> <CHOICE>$Resources:MyFieldChoice1</CHOICE> <CHOICE>$Resources:MyFieldChoice2</CHOICE> </CHOICES> </Field> </Elements>The sample above specifies a choice field, and uses localized strings for:
$Resources:[key]
whenever you want SharePoint to retrieve a localized string from the resource file of the current website’s culture.C:\…\12\Resources
instead of the local Resources folder inside the feature folder.<?xml version="1.0" encoding="utf-8" ?> <Feature xmlns="http://schemas.microsoft.com/sharepoint/" Id="5DFD12AF-D0AA-4c63-8FB8-C49DB1191083" Title="$Resources:MyResources,MyFeatureName" Scope="Site" Version="1.0.0.0"> <ElementManifests> <ElementManifest Location="SiteColumns.xml"/> </ElementManifests> </Feature>As you can see in the above sample, instead of
$Resources:MyFeatureName
I’m referencing the localized string with $Resources:MyResources,MyFeatureName
. This tells SharePoint to look for:MyFeatureName
MyResources.[Culture].resx
C:\…\12\Resources
folder <?xml version="1.0" encoding="utf-8" ?> <Feature xmlns="http://schemas.microsoft.com/sharepoint/" Id="5DFD12AF-D0AA-4c63-8FB8-C49DB1191083" Title="$Resources:MyFeatureName" DefaultResourceFile="MyResources" Scope="Site" Version="1.0.0.0"> <ElementManifests> <ElementManifest Location="SiteColumns.xml"/> </ElementManifests> </Feature>The sample above does exactly the same as the previous one. The only difference is that it specifies
MyResources.[culture].resx
as the default resource file and, because of that, you don’t need to specify it on all references to the localized strings.Resources.pt-PT.resx
. If it’s there, it loads all the strings from it. Resources.pt-PT.resx
file, but you have a Resources.pt-BR.resx
(Portuguese – Brazil) file, then SharePoint will use it. Resources.resx
). manifest.xml
). solution.ddf
). Feature.xml
). SiteColumns.xml
). .resx
) build.bat
) that creates the solution package <?xml version="1.0" encoding="utf-8" ?> <Feature xmlns="http://schemas.microsoft.com/sharepoint/" Id="{8213A053-46B0-43f9-B00C-B2A8CF7A3355}" Title="My Feature Stapling" Description="This feature staples other features to a site definition." Scope="Farm" Creator="Create IT" Version="1.0.0.0"> <ElementManifests> <ElementManifest Location="Elements.xml"/> </ElementManifests> </Feature>
Scope
value is Farm
. By default, SharePoint automatically activates features of this scope. You can, however, override this behaviour by setting the ActivateOnDefault
attribute to false
on the Feature
element. Elements.xml
. Elements.xml
), but it's root element must be <Elements>
. Inside this root element, you can place any number of feature element descriptions. In this example I will present the use of the <FeatureSiteTemplateAssociation>
element which is used to associate features to existing site definitions.<?xml version="1.0" encoding="utf-8" ?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <!-- My Site Columns --> <FeatureSiteTemplateAssociation Id="{CC3144A5-E055-4474-928E-5D21CDE53D38}" TemplateName="STS#0" /> <!-- My Content Types --> <FeatureSiteTemplateAssociation Id="{E739683D-ACB8-4187-A764-1323BE76D12D}" TemplateName="STS#0" /> </Elements>This example associates two features with the Team Site definition. The
<FeatureSiteTemplateAssociation>
element has no child elements and only two attributes:Id
- (required) The GUID of the feature that is to be stapled to the site definition. TemplateName
- (required) The name of the site definition including the configuration Id. For SharePoint’s out-of-the-box site definitions, this attribute can be: STS#0
(Team Site) STS#1
(Blank Site) STS#2
(Document Workspace) MPS#0
(Basic Meeting Workspace) MPS#1
(Blank Meeting Workspace) MPS#2
(Decision Meeting Workspace) MPS#3
(Social Meeting Workspace) MPS#4
(Multipage Meeting Workspace) CENTRALADMIN#0
(Central Administration) WIKI#0
(Wiki Site) BLOG#0
(Blog Site) BDR#0
(Document Center) OFFILE#1
(Records Center) SPSMSITEHOST#0
(My Site Host) SPSMSITE#0
(Personalization Site) CMSPUBLISHING#0
(Publishing Site) BLANKINTERNET#2
(Publishing Site with Workflow) BLANKINTERNETCONTAINER#0
(Publishing Portal) SPSPORTAL#0
(Collaboration Portal) SPSNHOME#0
(News Site) SPSITES#0
(Site Directory) SPSREPORTCENTER#0
(Report Center) SRCHCEN#0
(Search Center with Tabs) SRCHCENTERLITE#0
(Search Center) C:\…\12\TEMPLATE\[LCID]\XML
where [LCID]
represent the Language ID of the site definition you are looking for, and open each webtemp*.xml
file.<?xml version="1.0" encoding="utf-8"?> <!-- _lcid="1033" _version="12.0.4518" _dal="1" --> <!-- _LocalBinding --> <Templates xmlns:ows="Microsoft SharePoint"> <Template Name="STS" ID="1"> <Configuration ID="0" Title="Team Site" Hidden="FALSE" ImageUrl="/_layouts/images/stsprev.png" Description="A site for teams to quickly […] DisplayCategory="Collaboration" > </Configuration> <Configuration ID="1" Title="Blank Site" Hidden="FALSE" ImageUrl="/_layouts/images/blankprev.png" Description="A blank site for you to […] DisplayCategory="Collaboration" AllowGlobalFeatureAssociations="False" > </Configuration> <Configuration ID="2" Title="Document Workspace" Hidden="FALSE" ImageUrl="/_layouts/images/dwsprev.png" Description="A site for colleagues to work[…] DisplayCategory="Collaboration" > </Configuration> [...] </Template> </Templates>In the sample above you can see the description of the three configurations of the STS site template. To build the
TemplateName
required for the feature site template association, you get the template name (attribute Name
of the element Template
), which in this case is STS
, add a hash sign (#
) and complete the string with the configuration ID (attribute ID
of the element Configuration
), which in this case can be 0
, 1
or 2
, depending on the chosen configuration.manifest.xml
). solution.ddf
). Feature.xml
). Elements.xml
). build.bat
) that creates the solution package (MyFeatureStapling.wsp
). feature.xml
) schema.xml
file of the list template.onet.xml
file) and you had no access to its definition, you must do it using a Content Type Binding feature element. This can only be used to attach a content type to a list provisioned through a site definition.<?xml version="1.0" encoding="utf-8" ?> <Feature xmlns="http://schemas.microsoft.com/sharepoint/" Id="{ACDECF85-BDF7-446c-AC1B-C5F133C83F15}" Title="Content Type Binding" Description="This feature binds a content type to the masterpagegallery." Scope="Site" Creator="Create IT" Version="1.0.0.0"> <ElementManifests> <ElementManifest Location="ContentTypeBinding.xml"/> </ElementManifests> </Feature>Notes about this feature manifest:
Scope
value is Site
. ContentTypeBinding.xml
. ContentTypeBinding.xml
), but it's root element must be <Elements>
. Inside this root element, you can place any number of feature element descriptions. In this example I will present the use of the <ContentTypeBinding>
element which is used to binding Content Types to list definitions.<?xml version="1.0" encoding="utf-8" ?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <ContentTypeBinding ContentTypeId="0x010101" ListUrl="_catalogs/masterpage" /> </Elements>This example binds the content type Form (which has the ID
0x010101
) to the master page gallery (which has the URL _catalogs/masterpage
). There <ContentTypeBinding>
element has no child elements, and only two attributes:ContentTypeId
- (required) The ID of the content type that will be bound to a list. ListUrl
– (required) The URL of the list to which the content type will be bound. manifest.xml
). solution.ddf
). feature.xml
). ContentTypeBinding.xml
). build.bat
) that creates the solution package (ContentTypeBinding.wsp
). feature.xml
) <?xml version="1.0" encoding="utf-8" ?> <Feature xmlns="http://schemas.microsoft.com/sharepoint/" Id="{282902FB-0369-4f98-93C5-7FD7121CE164}" Title="My Event Receiver" Description="This feature registers My Event Receiver." Scope="Web" Creator="Create IT" Version="1.0.0.0"> <ElementManifests> <ElementManifest Location="EventReceivers.xml"/> </ElementManifests> </Feature>Notes about this feature manifest:
Scope
value is Web
. EventReceivers.xml
. EventReceivers.xml
), but it's root element must be <Elements>
. Inside this root element, you can place any number of feature element descriptions. In this example I will present the use of the <Receivers>
element which is used to register event receivers that will handle list events.<?xml version="1.0" encoding="utf-8" ?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <Receivers ListTemplateId="3500" ListTemplateOwner="{11663D54-6152-4532-ABF5-FC08FAC216A7}"> <Receiver> <Assembly> MyEventReceiver, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=6c0c7604915f786e </Assembly> <Class>MyEventReceiver.MyEventReceiver</Class> <Name>My Event Receiver</Name> <Type>ItemAdded</Type> <SequenceNumber>10000</SequenceNumber> </Receiver> </Receivers> </Elements>
3500
that was deployed by a feature with the ID {11663D54-6152-4532-ABF5-FC08FAC216A7}
. The receiver is the MyEventReceiver.MyEventReceiver
class included in the assembly MyEventReceiver.dll
that is installed in the GAC, and it handles the ItemAdded
event on these lists.<Receivers>
element is used to specify the list template to which the event receiver will be registered. There can be any number of <Receivers>
elements in a single element manifest file. Here is a summary of the possible attributes of this element:ListTemplateId
- (required) Specifies the ID of the list template to which the event receiver will be registered. If you wish to register an event receiver to one of SharePoint’s list templates, you can use one of the following values: ListTemplateOwner
- (optional) Specifies the GUID of the Feature where the list template is defined, or the name of the site definition that registered the list. <Receiver>
element specifies which class implements the event receiver and which list event it handles. There can any number <Receiver>
child elements inside a <Receivers>
parent element. This element has no attributes, but has six child elements, which are listed below:Assembly
– The strong name of the assembly that contains the event receiver class. The strong name is composed of the name of the assembly (without the .dll extension), followed by a comma and the assembly version, followed by a comma and the assembly culture, followed by a comma and the assembly’s public key token. Class
– The name of the class (including the namespace) that contains the implementation of the event receiver. Name
– The name of the event receiver. This value is used to identify it if you wish to retrieve it through the API. Type
– The event that the event receiver handles. Possible values are: ContextEvent
– The list received a context event. EmailReceived
– The list received an e-mail message. FieldAdded
– A field was added to the list. FieldAdding
– A field is being added to the list. FieldDeleted
– A field was removed from the list. FieldDeleting
– A field is being removed from the list. FieldUpdated
– A field was updated in the list. FieldUpdating
– A field is being updated in the list. ItemAdding
– An item is being added to the list. ItemAdded
– An item was added to the list. ItemAttachmentAdded
– An attachment was added to an item. ItemAttachmentAdding
– An attachment is being added to an item. ItemAttachmentDeleted
– An attachment was removed from an item. ItemAttachmentDeleting
– An attachment is being removed from an item. ItemCheckedIn
– An item was checked-in in the list. ItemCheckingIn
– An item is being checked-in in the list. ItemCheckedOut
– An item was checked-out in the list. ItemCheckingOut
– An item is being checked-out in the list. ItemDeleted
– An item was removed from the list. ItemDeleting
– An item is being removed from the list. ItemFileConverted
– A file was converted. ItemFileMoved
– A file was moved. ItemFileMoving
– A file is being moved. ItemUncheckedOut
– An item was unchecked-out in the list. ItemUncheckingOut
– An item is being unchecked-out in the list. ItemUpdated
– An item was updated in the list. ItemUpdating
– An item is being updated in the list. SequenceNumber
– Specifies the order of the event receiver when more than one handler is associated with the same event. A high sequence number (10000 or higher) should be used to prevent problems with SharePoint’s own event handlers. Data
– Specifies a string that will be passed as a parameter to the receiver method when handling the event. manifest.xml
). solution.ddf
). feature.xml
). EventReceivers.xml
). MyEventReceiver.dll
) that must be replaced by your own assembly. Important: this file is not a real assembly containing an event receiver class, hence it will not work if deployed as is to your Sharepoint environment. build.bat
) that creates the solution package (MyEventReceiver.wsp
). feature.xml
) <?xml version="1.0" encoding="utf-8" ?> <Feature xmlns="http://schemas.microsoft.com/sharepoint/" Title="My Module Feature" Id="17E94729-EF3E-4f43-9385-88E1201F91E0" Description="This feature adds files to the web site." Version="1.0.0.0" Scope="Web" Hidden="FALSE" DefaultResourceFile="core"> <ElementManifests> <ElementManifest Location="Modules.xml" /> <ElementFile Location="default.aspx" /> <ElementFile Location="MyMasterPage.master" /> <ElementFile Location="MyDocument.docx" /> <ElementFile Location="MyWebPart\MyWebPart.webpart" /> <ElementFile Location="MyStyles.css" /> </ElementManifests> </Feature>Notes about this feature manifest:
Scope
value is Web
. Modules.xml
. Module.xml
), but it's root element must be <Elements>
. Inside this root element, you can place any number of feature element descriptions. In this example I will present the use of the <Module>
element which is used to deploy Files to SharePoint web sites.<?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <!-- Page Module --> <Module Name="Pages" Url="" Path=""> <File Url="default.aspx" NavBarHome="True" IgnoreIfAlreadyExists="TRUE" Type="Ghostable"> <!-- Places Web Part on Page --> <AllUsersWebPart WebPartZoneID="Left" WebPartOrder="1"> <![CDATA[ <webParts> <webPart xmlns="http://schemas.microsoft.com/WebPart/v3"> <metaData> <type name="MyWebPart, MyWebPart.MyWebPart, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1255988569cf0248" /> <importErrorMessage> Cannot import My Web Part. </importErrorMessage> </metaData> <data> <properties> <property name="Title" type="string"> My Web Part </property> </properties> </data> </webPart> </webParts> ]]> </AllUsersWebPart> <!-- Places a List View for a Discussion Board --> <View List="Lists/Discussions" BaseViewID="4" Name="Discussions" WebPartZoneID="Left" WebPartOrder="2"/> <!-- Places a List View for a Document Library --> <View List="MyDocuments" BaseViewID="10" Name="My Documents" WebPartZoneID="Left" WebPartOrder="3"/> <!-- Customizes Navigation --> <NavBarPage Name="$Resources:core,nav_Home;" ID="1002" Position="Start" /> </File> </Module> <!-- Master Page Module --> <Module Name="Master Pages" List="116" Url="_catalogs/masterpage"> <File Url="MyMasterPage.master" Type="GhostableInLibrary" /> </Module> <!-- Document Module --> <Module Name="Documents" List="101" Url="MyDocuments"> <File Url="MyDocument.docx" Type="GhostableInLibrary" /> </Module> <!-- Web Part Module --> <Module Name="WebParts" List="113" Url="_catalogs/wp"> <File Path="MyWebPart\MyWebPart.webpart" Url="MyWebPart.webpart" Type="GhostableInLibrary" /> </Module> <!-- Style Sheet Module --> <Module Name="Stylesheets" List="101" Url="Style Library"> <File Url="MyStyles.css" Type="GhostableInLibrary" /> </Module> </Elements>
<Module>
element is used to specify a Module. There can be any number of modules in a single element manifest. Here is a summary of the possible attributes of this element:IncludeFolders
- (optional) I could figure out what this attribute is for... List
- (optional) Type of list where the files included in this module should be provisioned (check the possible values on my post about List Template Features). Name
- (required) Name of the module (file set). Path
- (optional) Specifies the physical path of the files, inside the feature folder (C:\Program Files\...\12\TEMPLATE\FEATURES\
[feature]). By default, SharePoint assumes the files are in the same folder as the element manifest file. You can also specify the path on each <File>
element (see below). RootWebOnly
- (optional) Boolean value. If TRUE
it specifies that the files in this module will only be provisioned on the root web site of a site collection. SetupPath
- (optional) Specifies the physical path to a folder, inside SharePoint's setup folder (C:\Program Files\...\12\TEMPLATE
), that contains the files included in the module. Url
- (optional) Specifies the virtual path of the folder in which to place the files of the module. This attribute is also used to provision a folder inside a list. If the Path
is not specified, the value of this attribute will be used for the physical path also. <File>
element is used to specify a file inside a module. There can be any number of <File>
elements inside a <Module>
element. See below a list of the possible attributes of this element:IgnoreIfAlreadyExists
- (optional) Boolean value. If TRUE
it specifies that the file should be provisioned even if it already exists on the destination URL. Name
- (optional) Specifies the virtual path for the file. NavBarHome
- (optional) Boolean value. If TRUE
it specifies that the file will be the destination of the Home link, used in the web site's navigation. This attribute is only used for web pages. Path
- (optional) Physical path to the file, inside the feature folder (C:\Program Files\...\12\TEMPLATE\FEATURES\
[feature]). This attribute is used if you need to specify a different path for each file inside the module. Otherwise, you can use the Path
attribute on the Module
element. Type
- (optional) Specifies if the file is to be stored in a Document Library (in this case the value should be GhostableInLibrary
) or outside of a list (in this case the value should be Ghostable
). Url
- (required) Specifies the virtual path for the file. If Name
is specified, then the value of this attribute is ignored. However, if Path
is not specified, the value of this attribute will be used for the physical path. <AllUsersWebPart>
element is used when you want to add a generic web part (non-List View web part) to a web part page. It can only be used inside a <File>
element that provisions a web part page file. It has only two attributes:WebPartOrder
- (required) Specifies the vertical position of the web part inside a web part zone. WebPartZoneID
- (required) Specifies the name of the web part zone. CDATA
element with the web part's XML description, either using the DWP file schema (also called V2) or the WEBPART file schema (also called V3).<View>
element is used when you want to add a List View Web Part to a web part page. It can only be used inside a <File>
element that provisions a web part page file. It has a lot of possible attributes, but I will only list the most common:List
- (optional) Specifies either the template type of the list (an integer value) or the URL of a list provisioned in the web site (a string value). On most cases, you should use the URL, since there might be two lists of the same type on the web site. BaseViewID
- (optional) Specifies the ID of the list view to be used. Name
- (optional) Specifies the name of the view. WebPartOrder
- (required) Specifies the vertical position of the web part inside a web part zone. WebPartZoneID
- (required) Specifies the name of the web part zone. <NavBarPage>
element is used to define how the navigation items should be created so that other pages link to this one. It can only be used inside a <File>
element that provisions a web page file. It has three attributes:ID
- (required) Specifies the ID for the page. This ID will be used by other pages when defining the relative position of the navigation items. Name
- (required) Specifies the text that is displayed in the navigation area of other pages that link to this one. Position
- (optional) Specifies the position of the navigation item on the navigation area of other pages that link to this one. This attribute can have the following possible values: Start
- Add the node to the start of the top navigation area. End
- Add the node to the end of the top navigation area. NavBarPage
element whose ID matches the number. <Property>
element is used only inside the <File>
element, to define the value of one or more properties of that file, once it is provisioned. It's mostly used to set properties of web part files or document files. It has only two attributes:Name
- (required) Name of the property to be set. Value
- (required) Value to set the property with. onet.xml
files included in each site template (look in C:\Program Files\...\12\TEMPLATE\SiteTemplates
). These files include a <Modules>
element which shares the same schema as the Module Features.feature.xml
) <?xml version="1.0" encoding="utf-8" ?> <Feature xmlns="http://schemas.microsoft.com/sharepoint/" Id="5DFD12AF-D0AA-4c63-8FB8-C49DB1191083" Title="My Custom Action Feature" Description="Adds Custom Actions to the Web Site." Scope="Web" Version="1.0.0.0"> <ElementManifests> <ElementManifest Location="CustomActions.xml"/> </ElementManifests> </Feature>
Scope
value is Web
. CustomActions.xml
. CustomActions.xml
), but it's root element must be <Elements>
. Inside this root element, you can place any number of feature element descriptions. In this example I will present the use of three feature elements:<CustomActionGroup>
used to create new custom action groups; <CustomAction>
used to create new custom actions; <HideCustomAction>
used to hide existing actions. <?xml version="1.0" encoding="utf-8" ?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <!-- Custom Action Group --> <CustomActionGroup Id="MyActionGroup" Description="This group contains all my custom actions." Title="My Action Group" Location="Microsoft.SharePoint.SiteSettings" Sequence="30" /> <!-- Custom Action in Custom Action Group --> <CustomAction Id="MyCustomAction" Description="This link is a custom action." Title="My Custom Action" GroupId="MyActionGroup" Location="Microsoft.SharePoint.SiteSettings" Rights="ManageWeb" RequireSiteAdministrator="FALSE" Sequence="20"> <UrlAction Url="~sitecollection/_layouts/MyCustomPage1.aspx" /> </CustomAction> <!-- Custom Action in Site Actions Menu --> <CustomAction Id="MyNewCustomAction" Description="This menu item is a new custom action." Title="My New Custom Action" GroupId="SiteActions" Location="Microsoft.SharePoint.StandardMenu" ImageUrl="/_layouts/MyActionIcon.jpg" Sequence="10"> <UrlAction Url="~sitecollection/_layouts/MyCustomPage2.aspx" /> </CustomAction> <!-- Hide Custom Action --> <HideCustomAction Id="HideDeleteWeb" GroupId="SiteAdministration" Location="Microsoft.SharePoint.SiteSettings" HideActionId="DeleteWeb" /> </Elements>
<CustomActionsGroup>
element is used to create custom action groups that can contain custom actions. In the sample above, a new custom action group, named My Action Group, is added to the Site Settings screen.Id
- (optional) Specifies a unique identifier for this group. It can be a GUID or a unique term, for example "SiteManagement"
. Description
- (optional) Description for the custom action group. Title
- (required) Title of the custom action group, shown to the user in the UI. Location
- (required) Specifies the place where the custom action group will be placed Microsoft.SharePoint.SiteSettings
- Site Settings screen Microsoft.SharePoint.ContentTypeSettings
- Content Type Settings screen Microsoft.SharePoint.Administration.Operations
- Operations screen in the Central Adminstration web site Microsoft.SharePoint.Administration.ApplicationManagement
- Application Management screen in the Central Administration Sequence
- (optional) Order of the custom action group in the list of groups that exist in the specified location. <CustomAction>
element is used to create a new custom action in the UI. In the above samples, two custom actions are created:Id
- (optional) Unique identifier to the custom action. The ID can be GUID or unique term, for example, "MyCustomAction"
. Description
- (optional) Description for the custom action. It will be displayed as a tooltip or sub-description for the action, depending on its location. Title
- (required) Title for the custom action. GroupId
- (optional) Specifies an action group inside which to place the custom action. If this custom action is contained inside a custom action group, the value of this attribute must match the value of the Id attribute of the <CustomActionGroup> element
. Location
- (required) Specifies the location for this custom action. If this custom action is contained inside a custom action group, the value of this attribute must match the value of the Location attribute of the <CustomActionGroup>
element. Check the possible values below, in the Locations and Group IDs section. ImageUrl
- (optional) Address of the image to use as the icon for this custom action. Note that, in certain locations, the custom actions don't have an icon. Rights
- (optional) Specifies a set of permissions that the user must have in order for the link to be visible. If omitted, the action always appears. To specify multiple values, separate them using commas (which means the user must have all the permissions specified). Check the possible values below, in the Action Rights section. RequireSiteAdministrator
- (optional) TRUE
to specifiy that the user must be a site administrator to see the custom action. The default value is FALSE
. This attribute is not supported if the custom action is to be placed in the context menu for a list item. Sequence
- (optional) Specifies the order of the custom action inside its action group. ContentTypeId
- (optional) Specifies the ID of the content type to associate with the custom action. ShowInReadOnlyContentTypes
- (optional) TRUE
to specify that the action should only appear in the Manage Content Type screen, for Read Only Content Types. The default value is FALSE
. ShowInSealedContentTypes
- (optional) TRUE
to specify that the action should only appear in the Manage Content Type screen, for Sealed Content Types. The default value is FALSE
. ControlAssembly
- (optional) Specifies the fully qualified name of the assembly of the control that supports the custom action. This attribute is used in conjunction with the next one. ControlClass
- (optional) Specifies the name of the class of the control that supports the custom action. This attribute is used in conjunction with the previous one. ControlSrc
- (optional) RegistrationType
- (optional) Used to specify the type of attachment in per-item custom actions. The possible values are: ContentType
FileType
List
ProgId
RegistrationId
- (optional) Depending on the RegistrationType
value, this attribute can hold a Content Type ID, a File Type identifier, a List ID or a Program identifier. <UrlAction>
element is used inside the <CustomAction>
element to specify what happens when the user clicks the link (or toolbar button, or menu item). It has a single attribute, Url
, which is the address of the page to redirect the user to.~site
- relative address of the current web site. ~sitecollection
- relative address of the root web site of the current site collection. {ItemId}
- ID (Integer value) of the item being acted upon (if applicable). {ItemUrl}
- URL of the item being acted upon (only works in document libraries). {ListId}
- GUID of the list. {SiteUrl}
- absolute URL of the current web site. {RecurrenceId}
- Recurrence index (not supported in the context menu of list items). <HideCustomAction>
element is used to hide an existing custom action. Id
- (optional) Specifies the ID of this hide custom action element. GroupId
- (optional) Identifies an action group that contains the action. Location
- (required) Specifies the location of the custom action to hide. Check the possible values in the table below. HideActionId
- (required) Specifies the ID of the action to hide. Description | Location | Group ID |
Display form toolbar | DisplayFormToolbar | N/A |
Edit form toolbar | EditFormToolbar | N/A |
New form toolbar | NewFormToolbar | N/A |
List view toolbar | ViewToolbar | N/A |
List item context menu | EditControlBlock | N/A |
New menu for list and document library view toolbars | Microsoft.SharePoint.StandardMenu | NewMenu |
Actions menu for list and document library view toolbars | Microsoft.SharePoint.StandardMenu | ActionsMenu |
Settings menu for list and document library view toolbars | Microsoft.SharePoint.StandardMenu | SettingsMenu |
Upload documents menu for document libraries | Microsoft.SharePoint.StandardMenu | UploadMenu |
Site Actions menu | Microsoft.SharePoint.StandardMenu | SiteActions |
Site Settings Site Collection Administration links | Microsoft.SharePoint.SiteSettings | SiteCollectionAdmin |
Site Settings Site Administration links | Microsoft.SharePoint.SiteSettings | SiteAdministration |
Site Settings Galleries Links | Microsoft.SharePoint.SiteSettings | Galleries |
Site Settings Look and Feel links | Microsoft.SharePoint.SiteSettings | Customization |
Site Settings Users and Permissions links | Microsoft.SharePoint.SiteSettings | UsersAndPermissions |
Site Actions menu for surveys | Microsoft.SharePoint.StandardMenu | ActionsMenuForSurvey |
Site Settings links for surveys | Microsoft.SharePoint.SiteSettings | SettingsMenuForSurvey |
Content Type Settings links | Microsoft.SharePoint.ContentTypeSettings | N/A |
Central Administration Operations page | Microsoft.SharePoint.Administration.Operations | N/A |
Central Administration Application Management page | Microsoft.SharePoint.Administration.ApplicationManagement | N/A |
Rights
attribute of the <CustomAction>
element. The list below summarizes the possible values for this attribute.