Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm trying to add a new group to the list form display ribbon that contains a few buttons. The group is created but it's blank. Here's the Elements.xml that defines the CustomAction:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction Id="BilSimser.Ribbon.CustomerGroup" 
                Location="CommandUI.Ribbon" RegistrationId="100" RegistrationType="List">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.ListForm.Display.Groups._children">
          <Group Id="BilSimser.Ribbon.ListForm.Display.CustomerGroup"
                 Sequence="100" Title="Customers"
                 Description="Links to customer views"
                 Template="Ribbon.Templates.Flexible">
            <Controls Id="BilSimser.Ribbon.ListForm.Display.CustomerGroup.Controls">
              <Button Id="BilSimser.Ribbon.ListForm.Display.CustomerGroup.OutageCustomerButton"
                      Sequence="10"
                      Command="BilSimser.CustomerGroup.Command.OutageCustomers"
                      TemplateAlias="o1"
                      Image16by16="/_layouts/images/FOLDER16.GIF"
                      Image32by32="/_layouts/images/FOLDER32.GIF"
                      LabelText="Outage Customers"/>
              <Button Id="BilSimser.Ribbon.ListForm.Display.CustomerGroup.CustomerClassificationButton"
                      Sequence="20"
                      Command="BilSimser.CustomerGroup.Command.CustomerClassification"
                      TemplateAlias="o1"
                      Image16by16="/_layouts/images/FOLDER16.GIF"
                      Image32by32="/_layouts/images/FOLDER32.GIF"
                      LabelText="Customer Classification"/>
              <Button Id="BilSimser.Ribbon.ListForm.Display.CustomerGroup.CriticalCustomerButton"
                      Sequence="30"
                      Command="BilSimser.CustomerGroup.Command.CriticalCustomers"
                      TemplateAlias="o1"
                      Image16by16="/_layouts/images/FOLDER16.GIF"
                      Image32by32="/_layouts/images/FOLDER32.GIF"
                      LabelText="Critical Customers"/>
              <Button Id="BilSimser.Ribbon.ListForm.Display.CustomerGroup.MajorCustomerButton"
                      Sequence="40"
                      Command="BilSimser.CustomerGroup.Command.MajorCustomers"
                      TemplateAlias="o1"
                      Image16by16="/_layouts/images/FOLDER16.GIF"
                      Image32by32="/_layouts/images/FOLDER32.GIF"
                      LabelText="Major Customers"/>
              <Button Id="BilSimser.Ribbon.ListForm.Display.CustomerGroup.StandardCustomerButton"
                      Sequence="50"
                      Command="BilSimser.CustomerGroup.Command.StandardCustomers"
                      TemplateAlias="o1"
                      Image16by16="/_layouts/images/FOLDER16.GIF"
                      Image32by32="/_layouts/images/FOLDER32.GIF"
                      LabelText="Standard Customers"/>
            </Controls>
          </Group>
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler Command="BilSimser.CustomerGroup.Command.OutageCustomers"
                          CommandAction="javascript:SP.UI.Notify.addNotification('outage customers');"/>
        <CommandUIHandler Command="BilSimser.CustomerGroup.Command.CustomerClassification"
                          CommandAction="javascript:SP.UI.Notify.addNotification('customer classification');"/>
        <CommandUIHandler Command="BilSimser.CustomerGroup.Command.CriticalCustomers"
                          CommandAction="javascript:SP.UI.Notify.addNotification('critical customers');"/>
        <CommandUIHandler Command="BilSimser.CustomerGroup.Command.MajorCustomers"
                          CommandAction="javascript:SP.UI.Notify.addNotification('major customers');"/>
        <CommandUIHandler Command="BilSimser.CustomerGroup.Command.StandardCustomers"
                          CommandAction="javascript:SP.UI.Notify.addNotification('standard customers');"/>
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>
</Elements>
share|improve this question
    
I've tried the above example from Bil with the changes from Andrey and it is telling me that the schema is invalid when I add the Scaling element. It looks like that element can only be under a Tab element... so how did you add it? –  marvin Apr 5 '12 at 1:08

2 Answers 2

up vote 7 down vote accepted

Bil! Looks like, you have missed Scaling element inside Groups element. Try add this to your definition:

      <Scaling Id="BilSimser.Ribbon.ListForm.Display.CustomerGroup.Scaling">
        <MaxSize
          Id="BilSimser.Ribbon.ListForm.Display.CustomerGroup.MaxSize"
          GroupId="BilSimser.Ribbon.ListForm.Display.CustomerGroup"
          Size="Large" />
        <Scale
          Id="BilSimser.Ribbon.ListForm.Display.CustomerGroup.Scale"
          GroupId="BilSimser.Ribbon.ListForm.Display.CustomerGroup"
          Size="Large" />
      </Scaling>

      <!-- Group element goes here -->

Also, as Andy Burns mentioned, it is better to always recreate Group Templates (you can "steal" their definitions from end of the "14\TEMPLATE\GLOBAL\XML\CMDUI.XML" file :)

The Ribbon.ListForm.Display tab uses only Flexible2 template, so this might be the reason too. To recreate Ribbon.Templates.Flexible, you can add this code to your definition:

<CommandUIDefinition Location="Ribbon.Templates._children">
  <GroupTemplate Id="BilSimser.Ribbon.Templates.Flexible">
    <Layout Title="Large">
      <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large"/>
    </Layout>
    <Layout Title="Medium">
      <OverflowSection Type="ThreeRow" TemplateAlias="o1" DisplayMode="Medium"/>
    </Layout>
    <Layout Title="MediumTwoRow">
      <OverflowSection Type="TwoRow" TemplateAlias="o1" DisplayMode="Medium" />
    </Layout>
    <Layout Title="Small">
      <OverflowSection Type="ThreeRow" TemplateAlias="o1" DisplayMode="Small" />
    </Layout>
    <Layout Title="Popup" LayoutTitle="Large" />
  </GroupTemplate>
 </CommandUIDefinition>

Also, do not forget to fix reference to template in this line:

       Template="BilSimser.Ribbon.Templates.Flexible">

Hope this helps! (sorry, cannot test myself to garantee 100% result, got SharePoint down on my computer after installing last CU :(... )

share|improve this answer
    
Thanks omlin, I had to add both the scaling and a custom group template to get it to work. –  Bil Simser Apr 13 '11 at 13:56

You may well need to define your own GroupTemplate. The out of box ones - such as Ribbon.Template.Flexible - are not necessarily available.

http://www.andrewconnell.com/blog/archive/2010/10/10/always-create-your-own-group-templates-with-sharepoint-ribbon-customizations.aspx

share|improve this answer
    
+1: yes that is what i have found as well spc3.codeplex.com/SourceControl/changeset/view/59904#1012111 –  djeeg Apr 13 '11 at 13:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.