Extend the Settings Ribbon Group in SharePoint 2010 for Document Libraries: Ribbon.Library.Settings.Controls

Posted by GeorgeH on November 26, 2011

This article demonstrates how to customise the settings group on the Ribbon for Document Libraries in SharePoint 2010. Custom Actions are created containing the new controls, which are integrated into Document Libraries in SharePoint 2010 by activating a Site Feature that contains the custom actions. An example is included to add a new control to the Settings group on the Ribbon.

When creating Custom Actions to extend the interface in SharePoint 2010, the RegistrationId attribute is used to specify which list/library type, content type or specific instance to add the new actions to. For generic Document Libraries the RegistrationId is set to 101, which applies to each of the examples below.

Example: Add a control to the Settings group on the Library tab on the Ribbon for Document Libraries in SharePoint 2010:

Ribbon.Library.Settings.Controls

<CustomAction Id="Ribbon.Library.Settings.Controls.CustomLink"
Location="CommandUI.Ribbon"
RegistrationId="101"
RegistrationType="List"
Title="Add to Existing Group">
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition
Location="Ribbon.Library.Settings.Controls._children">
<Button
Id="Ribbon.Library.Settings.CustomLink"
Sequence="95"
Command="Library.Settings.OpenCustomLink"
Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png"
Image16by16Top="-32" Image16by16Left="-88"
Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png"
Image32by32Top="-160" Image32by32Left="-448"
LabelText="Settings Group : Custom Link"
Description="Open Custom Link"
ToolTipTitle="Custom Action in Settings Group"
ToolTipDescription="Opens a Custom Link via a control added to the existing Settings group on the Ribbon under the Library tab"
TemplateAlias="o1" />
</CommandUIDefinition>
</CommandUIDefinitions>
<CommandUIHandlers>
<CommandUIHandler
Command="Library.Settings.OpenCustomLink"
CommandAction="http://blog-sharepoint.blogspot.com/"
/>
</CommandUIHandlers>
</CommandUIExtension>
</CustomAction>

The main components of this CustomAction example are:

  • CustomAction RegistrationId: "101" - Document Library
  • CustomAction Location: "CommandUI.Ribbon" - this location is required when extending the server Ribbon)
  • CommandUIDefinition Location: "Ribbon.Library.Settings.Controls._children" - this is the location value that indicates which part of the Ribbon to include the Custom Action. In this case, the location is set to "Ribbon.Library.Settings.Controls", which places the new Custom action in the Controls element of the Settings group for Document Libraries. The "_children" component indicates that we are adding a new child element to the Controls element.
  • Button: The button element is the control that is being added to the Settings group. It has a number of attributes used to configure the control as well as bind it to a CommandUIHandler element used to control the behaviour of the button control when clicked.
  • Button - Command: The Command reference value used to link the button to a specific CommandUIHandler element.
  • Button - LabelText: The text to display on the Button.

  • Button - ToolTipTitle: The title of the tooltip that is displayed when the mouse is hovered over the button.
  • Button - ToolTipDescription: The body text of the Tool Tip that is displayed when the mouse is hovered over the button.
  • CommandUIHandler: This element defines what a Custom Action does when clicked, which in this case opens an external url.
  • CommanUIHandler - Command: The Command attribute contains a value that matches the Command attribute of a control, which is used to bind one or more controls to the handler.
  • CommandUIHandler - CommandAction: The CommandAction attribute contains the URL or JavaScript that is executed when a corresponding control is pressed.


Related:

Extend the New Group for Document Libraries in SharePoint 2010 (Ribbon.Documents.New)
This tutorial contains a similar example to add a new control to the existing "New" group on the Ribbon for generic Document Libraries.

Add a button to the View Format Group (Ribbon.Library.ViewFormat) on the Ribbon for Document Libraries
This examples demonstrates how to add a Custom Action to the View Format group on the Ribbon for Document libraries in SharePoint 2010.

SharePoint 2010: Extend the Document Library Menus, Ribbon and Settings Interface
This tutorial provides a range of different examples for extending the Ribbon, Toolbar menus and the Settings page for Document Libraries in SharePoint 2010.

Add Custom Actions using SharePoint Designer 2010
This tutorial demonstrates how to add custom actions to lists and libraries in SharePoint 2010 using built-in functionality of SharePoint Designer 2010. This is a great way of extending the interface without having to create a site feature with the new links/controls to be added to the interface.

Add Custom Actions to SharePoint 2010 as a Feature
This post explains two different methods for adding new Custom Actions to SharePoint 2010 as a site feature. One method incorporates the new Custom Actions as a component of the project in Visual Studio, and the other demonstrates how to implement as a feature without using Visual Studio.

Rating

4/5

Reviews

There are currently no comments or reviews.

Submit a review:

Login required.