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

发布于 2024-11-15 18:13:17 字数 4213 浏览 4 评论 0原文

我是 SharePoint 功能区的新手。为什么我在标签页的管理组中看不到查看编辑按钮?

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

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

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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

葵雨 2024-11-22 18:13:17

我没有太多使用Sharepoint 的功能区,但据我了解,它与CRM 2011 功能区结构几乎相同。当 CRM 中出现缺少按钮的问题时,通常是缩放和最大尺寸的顺序问题。

按照顺序,所有 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>

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>
渔村楼浪 2024-11-22 18:13:17

好吧,这就是我必须做的:

  1. 不要在 ID 中使用 _(下划线)
  2. 更改我的布局以使用 OverflowSection

以下是我的最终定义,以防您需要:

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

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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文