Writing Custom Actions

By now you should be familiar with the various SharePoint components such as the ribbon, the Site Actions menu, and the context menu that appears in a list (more accurately the Edit menu). All these components represent various important tasks within SharePoint and form an indispensible part of the SharePoint user interface. These are also the components that you may need to modify or add to when customizing your SharePoint application.

SharePoint provides a rich, consistent, and simple mechanism to customize these components through custom actions. According to Microsoft a custom action represents a server ribbon, menu, or link customization that a user can see.


By the Way

Custom actions can be bound to a list type, content type, file type, or programmatic identifier (ProgID). (Refer to http://msdn.microsoft.com/en-us/library/ms458635.aspx.)


Now take a look at XML. The <CustomAction> tag defines a new custom action. The Id attribute specifies a unique identifier for the custom action. The Title and Description attributes specify the text and description for the custom action. The GroupId is an optional attribute that specifies the group that contains the custom action. In this case the group is SiteActions. The Location attribute along with the GroupId specifies the location where the custom action appears. In this case the location is Microsoft.SharePoint.StandardMenu. You can find the list of the default custom action group IDs that are used in Microsoft SharePoint Foundation at http://msdn.microsoft.com/en-us/library/bb802730.aspx.

The other attributes you can see are the ImageUrl attribute, which specifies the icon for the custom action, and the Sequence attribute, which specifies the ordering priority for the custom action. In addition you can see the UrlAction element, which specifies the URL to which the custom action points.

In addition to the ones just mentioned, there are many other attributes and elements that we see later on in this hour.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset