Question

I am new to SharePoint ribbon. Why do I not see the View and Edit buttons in the Manage group of my tab?

Here are my definitions for your reference:

<ContextualGroup Id="Ribbon.MyWorkContextualTabGroup"
  Color="Blue" Title="{title}" 
  Command="MyWorkContextualTab.EnableContextualGroup" 
  Sequence="502" 
  ContextualGroupId="MyWorkContextualTabGroup">
  <Tab Id="Ribbon.MyWorkTab" 
       Title="My Work" 
       Description="My Work tab description" 
       Command="MyWorkContextualTab.EnableMyWorkTab" 
       Sequence="501">
    <Scaling Id="Ribbon.MyWorkTab.Scaling">
      <MaxSize Id="Ribbon.MyWorkTab.MaxSize_New"
               GroupId="Ribbon.MyWorkTab.MyWorkGroup_New"
               Size="MyWorkLayout"
               Sequence="10"/>

      <MaxSize Id="Ribbon.MyWorkTab.MaxSize_Manage"
               GroupId="Ribbon.MyWorkTab.MyWorkGroup_Manage"
               Size="MyWorkLayout"
               Sequence="20" />

      <Scale Id="Ribbon.MyWorkTab.Scalling.MyWorkTabScalling_New"
             GroupId="Ribbon.MyWorkTab.MyWorkGroup_New"
             Size="MyWorkLayout"
             Sequence="30" />

      <Scale Id="Ribbon.MyWorkTab.Scalling.MyWorkTabScalling_Manage"
             GroupId="Ribbon.MyWorkTab.MyWorkGroup_Manage"
             Size="MyWorkLayout"
             Sequence="40"/>
    </Scaling>
    <Groups Id="Ribbon.MyWorkTab.Groups">
      <Group Id="Ribbon.MyWorkTab.MyWorkGroup_New" 
             Description="New group description" 
             Title="New" 
             Command="MyWorkContextualTab.EnableMyWorkGroup_New" 
             Sequence="52" 
             Template="Ribbon.Templates.MyWorkTemplate">
        <Controls Id="Ribbon.MyWorkTab.MyWorkGroup_New.Controls">
          <Button Id="Ribbon.MyWorkTab.MyWorkGroup_New.NewItem" 
                  Command="MyWorkContextualTab.NewItemCommand" 
                  Sequence="15" 
                  Description="Add a new item" 
                  LabelText="New Item" 
                  TemplateAlias="ONE_R1" 
                  Image32by32="_layouts/images/mywork/ribbon/newitem.png" />
        </Controls>
      </Group>
      <Group Id="Ribbon.MyWorkTab.MyWorkGroup_Manage" 
             Description="Manage group description" 
             Title="Manage" 
             Command="MyWorkContextualTab.EnableMyWorkGroup_Manage" 
             Sequence="53" 
             Template="Ribbon.Templates.MyWorkTemplate">
        <Controls Id="Ribbon.MyWorkTab.MyWorkGroup_Manage.Controls">
          <Button Id="Ribbon.MyWorkTab.MyWorkGroup_Manage.ViewItem" 
                  Command="MyWorkContextualTab.ViewItemCommand" 
                  Sequence="25" 
                  Description="View this item" 
                  LabelText="View Item" 
                  TemplateAlias="ONE_R1" 
                  Image32by32="_layouts/images/mywork/ribbon/viewitem.png" />
          <Button Id="Ribbon.MyWorkTab.MyWorkGroup_Manage.EditItem" 
                  Command="MyWorkContextualTab.EditItemCommand" 
                  Sequence="35"
                  Description="Edit this item" 
                  LabelText="Edit Item" 
                  TemplateAlias="ONE_R1" 
                  Image32by32="_layouts/images/mywork/ribbon/edititem.png" />
        </Controls>
      </Group>
    </Groups>
  </Tab>
</ContextualGroup>


<GroupTemplate Id="Ribbon.Templates.MyWorkTemplate">
  <Layout Title="MyWorkLayout" LayoutTitle="MyWorkLayout">
    <Section Alignment="Top" Type="OneRow">
      <Row>
        <ControlRef DisplayMode="Large" TemplateAlias="ONE_R1"/>
      </Row>
    </Section>
    <Section Alignment="Top" Type="ThreeRow">
      <Row>
        <ControlRef DisplayMode="Medium" TemplateAlias="THE_R1"/>
      </Row>
      <Row>
        <ControlRef DisplayMode="Medium" TemplateAlias="THE_R2"/>
      </Row>
      <Row>
        <ControlRef DisplayMode="Medium" TemplateAlias="THE_R3"/>
      </Row>
    </Section>
  </Layout>
</GroupTemplate>
Was it helpful?

Solution 2

Okay this is what I had to do:

  1. Do not use _ (underscore) in the Id.
  2. Change my layout to use OverflowSection

Here are my final definitions in case if you need:

<ContextualGroup Id="Ribbon.MyWorkContextualTabGroup"
  Color="Blue" Title="{title}" 
  Command="MyWorkContextualTab.EnableContextualGroup" 
  Sequence="502" 
  ContextualGroupId="MyWorkContextualTabGroup">
  <Tab Id="Ribbon.MyWorkTab" 
       Title="My Work" 
       Description="My Work tab description" 
       Command="MyWorkContextualTab.EnableMyWorkTab" 
       Sequence="501">
    <Scaling Id="Ribbon.MyWorkTab.Scaling">
      <MaxSize Id="Ribbon.MyWorkTab.MaxSizeNew"
               GroupId="Ribbon.MyWorkTab.MyWorkGroupNew"
               Size="MyWorkLayout"
               Sequence="10"/>

      <MaxSize Id="Ribbon.MyWorkTab.MaxSizeManage"
               GroupId="Ribbon.MyWorkTab.MyWorkGroupManage"
               Size="MyWorkLayout"
               Sequence="20" />

      <Scale Id="Ribbon.MyWorkTab.Scaling.MyWorkTabScalingNew"
             GroupId="Ribbon.MyWorkTab.MyWorkGroupNew"
             Size="MyWorkLayout"
             Sequence="30" />

      <Scale Id="Ribbon.MyWorkTab.Scaling.MyWorkTabScalingManage"
             GroupId="Ribbon.MyWorkTab.MyWorkGroupManage"
             Size="MyWorkLayout"
             Sequence="40"/>
    </Scaling>
    <Groups Id="Ribbon.MyWorkTab.Groups">
      <Group Id="Ribbon.MyWorkTab.MyWorkGroupNew" 
             Description="New group description" 
             Title="New" 
             Command="MyWorkContextualTab.EnableMyWorkGroupNew" 
             Sequence="52" 
             Template="Ribbon.Templates.MyWorkTemplate">
        <Controls Id="Ribbon.MyWorkTab.MyWorkGroupNew.Controls">
          <Button Id="Ribbon.MyWorkTab.MyWorkGroupNew.NewItem" 
                  Command="MyWorkContextualTab.NewItemCommand" 
                  Sequence="15" 
                  Description="Add a new item" 
                  LabelText="New Item" 
                  TemplateAlias="ONERW" 
                  Image32by32="_layouts/images/mywork/ribbon/newitem-32.png" />
        </Controls>
      </Group>
      <Group Id="Ribbon.MyWorkTab.MyWorkGroupManage" 
             Description="Manage group description" 
             Title="Manage" 
             Command="MyWorkContextualTab.EnableMyWorkGroupManage" 
             Sequence="53" 
             Template="Ribbon.Templates.MyWorkTemplate">
        <Controls Id="Ribbon.MyWorkTab.MyWorkGroupManage.Controls">
          <Button Id="Ribbon.MyWorkTab.MyWorkGroupManage.ViewItem" 
                  Command="MyWorkContextualTab.ViewItemCommand" 
                  Sequence="25" 
                  Description="View this item" 
                  LabelText="View Item" 
                  TemplateAlias="ONERW" 
                  Image32by32="_layouts/images/mywork/ribbon/viewitem-32.png" />
          <Button Id="Ribbon.MyWorkTab.MyWorkGroupManage.EditItem" 
                  Command="MyWorkContextualTab.EditItemCommand" 
                  Sequence="35"
                  Description="Edit this item" 
                  LabelText="Edit Item" 
                  TemplateAlias="ONERW" 
                  Image32by32="_layouts/images/mywork/ribbon/edititem-32.png" />
        </Controls>
      </Group>
    </Groups>
  </Tab>
</ContextualGroup>


<GroupTemplate Id="Ribbon.Templates.MyWorkTemplate">
  <Layout Title="MyWorkLayout" LayoutTitle="MyWorkLayout">
    <OverflowSection Type="OneRow" DisplayMode="Large" TemplateAlias="ONERW"/>
  </Layout>
</GroupTemplate>

OTHER TIPS

I havent worked with Sharepoint's Ribbon much, but from what I understand it is almost identical to CRM 2011 ribbon structure. When the issue of missing buttons crop up in CRM it is usually a sequence issue with Scaling and MaxSize.

All of the MaxSize element need to come before the Scale elements in terms of sequence. I would try adding the sequence numbers to the MaxSize/Scale elements in your Scaling section and adjust the numbers to make sure maxsize appears before scale.

Hope this helps.

example:

<Scaling Id="Ribbon.MyWorkTab.Scaling">      
         <MaxSize Id="Ribbon.MyWorkTab.MaxSize_New" 
                  GroupId="Ribbon.MyWorkTab.MyWorkGroup_New" 
                  Size="MyWorkLayout" 
                  Sequence="10"/>

         <MaxSize Id="Ribbon.MyWorkTab.MaxSize_Manage" 
                  GroupId="Ribbon.MyWorkTab.MyWorkGroup_Manage" 
                  Size="MyWorkLayout" 
                  Sequence="20" />  

        <Scale Id="Ribbon.MyWorkTab.Scalling.MyWorkTabScalling_New" 
               GroupId="Ribbon.MyWorkTab.MyWorkGroup_New" 
               Size="MyWorkLayout" 
               Sequence="30" /> 

        <Scale Id="Ribbon.MyWorkTab.Scalling.MyWorkTabScalling_Manage" 
               GroupId="Ribbon.MyWorkTab.MyWorkGroup_Manage" 
               Size="MyWorkLayout" 
               Sequence="40"/> 
</Scaling>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top