(服务器功能区) 的 Layout 元素

适用于: SharePoint 2016 |SharePoint Foundation 2013 |SharePoint Online |SharePoint Server 2013

定义模板中控件的布局。

<Layout
  Title="Text"
  LayoutTitle="Text"
/>

元素和属性

下面各部分介绍了属性、子元素和父元素。

Attributes

属性 说明
Title
必需。标识其父 GroupTemplate 元素中元素的字符串。文档对象模型 (DOM) 中元素的 ID 以“ParentId-Title”的模式构成。
LayoutTitle
可选。 元素的其他标识符。 使用此属性可在 Title 属性的值为“Popup”时提供一个标题。

子元素

父元素

出现次数

  • 最小值:0
  • 最大值:无限制

示例

下面的 XML 片段示例定义具有多个 Layout 元素的组模板。

<GroupTemplate Id="Ribbon.Templates.FontGroup">
  <Layout Title="Large">
    <Section Type="TwoRow" Alignment="Middle">
      <Row>
        <ControlRef TemplateAlias="font" DisplayMode="Medium" />
        <ControlRef TemplateAlias="fontsize" DisplayMode="Medium" />
      </Row>
      <Row>
        <Strip>
          <ControlRef TemplateAlias="bold" DisplayMode="Small" />
          <ControlRef TemplateAlias="italics" DisplayMode="Small" />
          <ControlRef TemplateAlias="underline" DisplayMode="Small" />
          <ControlRef TemplateAlias="strikethrough" DisplayMode="Small" />
          <ControlRef TemplateAlias="subscript" DisplayMode="Small" />
          <ControlRef TemplateAlias="superscript" DisplayMode="Small" />
        </Strip>
        <Strip>
          <ControlRef TemplateAlias="backgroundcolor" DisplayMode="Small" />
          <ControlRef TemplateAlias="fontcolor" DisplayMode="Small" />
        </Strip>
        <Strip>
          <ControlRef TemplateAlias="clearformat" DisplayMode="Small" />
        </Strip>
      </Row>
    </Section>
    <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large"/>
  </Layout>
  <Layout Title="Medium">
    <Section Type="ThreeRow">
      <Row>
        <ControlRef TemplateAlias="font" DisplayMode="Medium" />
        <ControlRef TemplateAlias="fontsize" DisplayMode="Medium" />
      </Row>
      <Row>
        <Strip>
          <ControlRef TemplateAlias="bold" DisplayMode="Small" />
          <ControlRef TemplateAlias="italics" DisplayMode="Small" />
          <ControlRef TemplateAlias="underline" DisplayMode="Small" />
          <ControlRef TemplateAlias="strikethrough" DisplayMode="Small" />
          <ControlRef TemplateAlias="subscript" DisplayMode="Small" />
          <ControlRef TemplateAlias="superscript" DisplayMode="Small" />
        </Strip>
      </Row>
      <Row>
        <Strip>
          <ControlRef TemplateAlias="backgroundcolor" DisplayMode="Small" />
          <ControlRef TemplateAlias="fontcolor" DisplayMode="Small" />
        </Strip>
        <Strip>
          <ControlRef TemplateAlias="clearformat" DisplayMode="Small" />
        </Strip>
      </Row>
    </Section>
    <OverflowSection Type="ThreeRow" TemplateAlias="o1" DisplayMode="Medium"/>
  </Layout>
  <Layout Title="Popup" LayoutTitle="Large" />
</GroupTemplate>