Click or drag to resize
RibbonLayoutsPage

RibbonLayoutsPage is base class for simplifying creation of Application Pages with ribbon.

Creating a simple demo

  1. Create new SharePoint Empty Project in Visual Studio 2010

  2. Add reference to FluentRibbon.dll

  3. Add FluentRibbon.dll into GAC deployment list (Package.package, 'Advanced' tab)

  4. Add 'Layouts' SharePoint Mapped folder to the project

  5. Add Application Page item into the 'Layouts' folder

  6. Inherit ApplicationPage1 class from RibbonLayoutsPage

  7. Override GetTabDefinition method and provide ribbon definition, using classes from FluentRibbon.Definition namespace

  8. Deploy!

Example
C#
public partial class ApplicationPage1 : RibbonLayoutsPage

{

    public override TabDefinition GetTabDefinition()

    {

        return new TabDefinition()

        {

            Id = "TestRibbon",

            Title = "Test",

            Groups = new GroupDefinition[]

            {

                new GroupDefinition()

                {

                    Id = "TestGroup",

                    Title = "Test group",

                    Template = GroupTemplateLibrary.SimpleTemplate,

                    Controls = new ControlDefinition[]

                    {

                        new ButtonDefinition()

                        {

                            Id = "TestButton",

                            Title = "Test button",

                            CommandJavaScript = "alert('test!');",

                            Image = ImageLibrary.GetStandardImage(6, 0)

                        }

                    }

                }

            }



        };

    }

}

You will see the following result after deployment of this code:

ribbon Layouts Page
See Also