Click or drag to resize
Getting started

Project Description

Ribbon is a central SharePoint 2010 feature, but for developer it is not so handy, as for a user.

This project aims to provide fluent API for Ribbon creation and managing in SharePoint 2010.

This project contains following main features:

  1. ContextualWebPart - base class for webparts with contextual ribbon tabs

  2. RibbonLayoutsPage - base class for Application Pages with ribbon

  3. RibbonControl - base class for delegate controls with ribbon

  4. RibbonCustomAction - provision ribbon with Fluent Ribbon definition classes (alternative to SharePoint XML provisioning)

Getting started with Fluent Ribbon

Here is a little how-to on using FluentRibbon project in your custom ribbon projects.

  1. Add reference to FluentRibbon.dll from your SharePoint project

  2. Include FluentRibbon.dll in Package.package for GAC deploying ('Advanced' tab).

  3. Inherit either your webpart class or Application Page code behind class from corresponding FluentRibbon classes.

  4. Override ribbon definition method (GetContextualGroupDefinition or GetTabDefinition), and provide ribbon definition to FluentRibbon.

  5. Deploy!

Definition classes are well-documented, so you'll get intellisense and summary notes on each property.

For example, button definition could look like this:

C#
new ButtonDefinition()

{

    Id = "New",

    Title = "Start new game",

    CommandJavaScript = "window.location.reload();",

    Image = new ImageDefinition()

    { 

        Url16 = "/_layouts/images/ChessWebPart/new16.png",

        Url32 = "/_layouts/images/ChessWebPart/new32.png"

    }

}

This code will result in following ribbon button:

button Sample

Also, you can partially use FluentRibbon with sandboxed solutions and SharePoint Online (Office365). By now, only the RibbonCustomAction feature is supported.

For this purpose, you should use FluentRibbon.Sandboxed.dll instead of FluentRibbon.dll. For details, please see article about RibbonCustomAction.

See Also