SharePoint中的功能区上下文组和选项卡

时间:2011-06-17 19:00:28

标签: sharepoint sharepoint-2010 sharepoint-2007 ribbon ribbon-control

我是SharePoint功能区的新手。为什么我的标签View组中没有EditManage按钮?

以下是我的定义供您参考:

<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>

2 个答案:

答案 0 :(得分:2)

我没有使用过Sharepoint的Ribbon,但据我所知,它几乎与CRM 2011的Ribbon结构完全相同。当在CRM中出现丢失按钮的问题时,通常是Scaling和MaxSize的序列问题。

所有MaxSize元素都需要在序列方面位于Scale元素之前。我会尝试将序列号添加到缩放部分的MaxSize / Scale元素中,并调整数字以确保在缩放之前出现maxsize。

希望这会有所帮助。

示例:

<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>

答案 1 :(得分:1)

好的,这就是我必须做的事情:

  1. 请勿在ID中使用_ (underscore)
  2. 更改我的布局以使用OverflowSection
  3. 如果您需要,以下是我的最终定义:

    <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>