locked
Add new tab to Ribbon RRS feed

  • Question

  • I'm trying to create a custom Ribbon tab in SharePoint 2010 for a small proof-of-concept application. The only example I could find on the Internet was http://sharepointsolutions.com/sharepoint-help/blog/index.php/2009/10/creating-a-custom-ribbon-tab-in-sharepoint-2010/, but unfortunately the solution provided doesn't work with SharePoin 2010 Beta2.

    Here's what I've already tried: I created a feature with the custom Ribbon definition like this:
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
      <CustomAction
        Id="SomeRibbon"
        Location="CommandUI.Ribbon"
        Sequence="100"
        Title="Test">
        <CommandUIExtension>
          <CommandUIDefinitions>
            <CommandUIDefinition Location="CommandUI.Ribbon.Tabs._children">
              <Tab Id="SomeRibbon.Tab1" Command="SomeRibbonTab1Command" Title="Tab one"
                   Description="My custom tab" Sequence="100">
                <Scaling Id="SomeRibbon.Tab1.Scaling">
                  <MaxSize Id="SomeRibbon.Tab1.Scaling.Group1.MaxSize" Sequence="10" GroupId="SomeRibbon.Tab1.Group1" Size="LargeLarge" />
                </Scaling>
                <Groups Id="SomeRibbon.Tab1.Groups">
                  <Group
                    Id="SomeRibbon.Tab1.Group1"
                    Sequence="10"
                    Command="SomeRibbonTab1Group1Command"
                    Description=""
                    Title="Crazy group"
                    Template="Ribbon.Templates.Flexible2">
                    <Controls Id="SomeRibbon.Tab1.Group1.Controls">
                      <Button
                        Id="SomeRibbon.Tab1.Group1.MakeIt"
                        Command="SomeRibbonTab1Group1MakeItCommand"
                        Image16by16="/_layouts/images/FILMSTRP.GIF"
                        Image32by32="/_layouts/images/PPEOPLE.GIF">
    		[...]
    Then I added a web part that should show my newly inserted tab

     SPRibbon ribbon = SPRibbon.GetCurrent(this.Page);
                
                if (ribbon != null)
                {                
                    ribbon.MakeTabAvailable("Ribbon.WebApp");                
                    ribbon.MakeTabAvailable("SomeRibbon.Tab1");
                    ribbon.InitialTabId = "SomeRibbon.Tab1";                
                }
    But although the web application tab is shown, there is literally no sign of my custom tab. No exception or whatsoever occurs, it simply doesn't show up. I alredy cleared my IE cache and resetted IIS, but this also didn't help.

    Anyone has already archieved this and is willing to help? Thanks in advance!
    Tuesday, November 24, 2009 12:45 PM

All replies

  • wow this is great and it put our steps on the first step to go... but please tell me.. what project template so i can start from scratch and do my own ribbon i deployed this already but what project template?
    Tuesday, November 24, 2009 1:54 PM
  • Can you please share the whole project so I can test along with you?

    As for the blog post you mentioned I downloaded the code http://sharepointribbonsample.googlecode.com/files/Create%20a%20Custom%20Ribbon%20Tab.zip , but it seems there are some atributes  like "Location" were missiing , after updating it  with "CommandUI.Ribbon.Tabs._children" , and now looking forward to show it as there is no webpart available in the project.


    http://razi.spaces.live.com/
    Wednesday, November 25, 2009 10:52 AM
  • Hi Thomas,

    I haven't been able to look at your code, but if you're looking for another example/tutorial, there is a series of Hands on labs at http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=c010fc68-b47f-4db6-b8a8-ad4ba33a35c5. One of them is entitled "Developing SharePoint 2010 User Interface Ribbon and Dialog Customizations". Looking at the publish date I'm pretty sure these must be aimed at Beta 2. Anyway, hope this helps.

    Regards,

    Geoff
    Wednesday, November 25, 2009 3:27 PM
  •  
    The lab titled "Developing SharePoint 2010 User Interface Ribbon and Dialog Customizations" only demonstrate's how to add a Button to the ribbon not the Tab.
    http://razi.spaces.live.com/
    Thursday, November 26, 2009 2:56 AM
  • I am having the same problem, no tabs or custom buttons are showed and I tried several tutorials... does anyone knows a solution for this problem? It looks like this problem only shows up in the Beta2?
    Thursday, March 18, 2010 7:59 AM
  • Hello,

    Maybe this link could help you : http://www.sharepointnutsandbolts.com/2010/01/customizing-ribbon-part-1-creating-tabs.html

    I have the beta version of SPS 2010 and I can add tab to the ribbon, but I guess there is a bug because when I click on my custom tab and then I click on an other tab, the content of the other that doesn't change... Strange... I have to test it in the RC version...

    Regards


    http://www.areaprog.com
    Friday, March 19, 2010 9:37 AM
  • There have been several add ons and packages available nowadays in market, that you can use to do these kind of things very effectively.

    For eg: If you are looking for a document generation add-on to SharePoint, take a look at this Sharepoint Document Generation site. It has basic info on all the vendors. It makes for a great starting point.

    Wednesday, October 6, 2010 12:23 PM
  • Tuesday, July 12, 2011 1:53 AM
  • Hi ,

    Could you please try by changing the  Sequence="501" the  tab . i mean change the code as below

    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
     <CustomAction
      Id="SomeRibbon"
      Location="CommandUI.Ribbon"
      Sequence="501"
      Title="Test">
      <CommandUIExtension>
       <CommandUIDefinitions>
        <CommandUIDefinition Location="CommandUI.Ribbon.Tabs._children">
         <Tab Id="SomeRibbon.Tab1" Command="SomeRibbonTab1Command" Title="Tab one"
            Description="My custom tab" Sequence="100">
          <Scaling Id="SomeRibbon.Tab1.Scaling">
           <MaxSize Id="SomeRibbon.Tab1.Scaling.Group1.MaxSize" Sequence="10" GroupId="SomeRibbon.Tab1.Group1" Size="LargeLarge" />
          </Scaling>
          <Groups Id="SomeRibbon.Tab1.Groups">
           <Group
            Id="SomeRibbon.Tab1.Group1"
            Sequence="10"
            Command="SomeRibbonTab1Group1Command"
            Description=""
            Title="Crazy group"
            Template="Ribbon.Templates.Flexible2">
            <Controls Id="SomeRibbon.Tab1.Group1.Controls">
             <Button
              Id="SomeRibbon.Tab1.Group1.MakeIt"
              Command="SomeRibbonTab1Group1MakeItCommand"
              Image16by16="/_layouts/images/FILMSTRP.GIF"
              Image32by32="/_layouts/images/PPEOPLE.GIF">

    • Proposed as answer by ahamedzakeer Monday, October 3, 2011 11:18 AM
    Monday, August 8, 2011 6:38 AM
  • hi I need to create a custom Ribbon tab by using the feature i have followed the xml content as follows as below

    <?xml version=”1.0″ encoding=”utf-8″?>
    <Elements xmlns=”http://schemas.microsoft.com/sharepoint/”>
      <CustomAction
        Id=”MyProject.RibbonButton”
      
        Title=”New Ribbon Button”
        Location=”CommandUI.Ribbon”
        Sequence="501">
                             
        <CommandUIExtension>
          <CommandUIDefinition Location=”Ribbon.Tabs._children”>
             
           <Tab
              Id="MyProject.Ribbon.HelloTab" Command="SomeRibbonTab1Command"  Title="Custom Tab Title">
            
                <Scaling Id="Ribbon.Read.Scaling">
                </Scaling>
                <Groups Id="Ribbon.Read.Groups">
                </Groups>
              </Tab>
            
            </CommandUIDefinition>
          <CommandUIHandlers>
          </CommandUIHandlers>
        </CommandUIExtension>
      </CustomAction>
    </Elements>

    but i was unable to create  i was getting the error like

    "

    Only Content controls are allowed directly in a content page that contains Content controls. "
    Please help me in this regard how to create a Ribbon tab in the Home.aspx Page
    Friday, September 16, 2011 6:06 AM
  • but i was unable to create  i was getting the error like"
    Only Content controls are allowed directly in a content page that contains Content controls. "
    Please help me in this regard how to create a Ribbon tab in the Home.aspx Page


    Hi,

    I think this error may be due the content controls placement, have a look at the below Url,

    http://edinkapic.blogspot.com/2008/10/only-content-controls-are-allowed.html

    Let me know.

     


    Praveen Mandalapu Please mark answered if I've answered your question and vote for it as helpful to help other user's find a solution quicker!
    Friday, September 16, 2011 6:25 AM
  • There have been several add ons and packages available nowadays in market, that you can use to do these kind of things very effectively.

    For eg: If you are looking for a document generation add-on to SharePoint, take a look at this Sharepoint Document Generation site. It has basic info on all the vendors. It makes for a great starting point.

    You also can try this sharepoint document generation software.
    Wednesday, January 4, 2012 1:24 PM