7

如何水平放置多个自定义按钮 - 在 tridion 功能区中一个在另一个下方。

就像我们有签入、签出、撤消签出按钮一样。

我尝试通过将它们放在一个组中来创建多个自定义按钮,但默认情况下它们并排对齐,但不是一个在另一个下方。

4

1 回答 1

11

我关于 Tridion Developer 的一篇文章中,我解释了所有关于如何使用功能区项目组的内容,这可以将小按钮放在彼此下方,这样您就可以在 2 个大按钮(彼此相邻)的空间中放置 3 个按钮.

RibbonItemGroup 不是您可以在 UI 扩展的配置文件中定义的东西,它是您需要指定的 Tridion 用户控件 (.ascx)。

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ViewItemsGroup.ascx.cs" Inherits="SDL.Examples.UI.Controls.ViewItemsGroup" %>
<%@ Import Namespace="Tridion.Web.UI" %>
<c:RibbonItemsGroup runat="server" ID="RibbonItemsGroup">
  <c:RibbonButton runat="server" CommandName="ViewStaging" Title="View in Staging" Label="View In Staging" IsSmallButton="true" ID="ViewStagingBtn" />
  <c:RibbonButton runat="server" CommandName="ViewLive" Title="View in Live" Label="View in Live" IsSmallButton="true" ID="ViewLiveBtn" />
</c:RibbonItemsGroup>

文件后面的代码扩展了 Tridion.Web.UI.Controls.TridionUserControl,不需要任何特定代码。要将其包含在功能区工具栏中,请在配置文件中使用以下 XML 将功能区项目组指定为扩展:

<ext:extension assignid="ViewItemsGroup" groupid="EditGroup" name="View" pageid="HomePage" insertbefore="PublishGroup">
  <ext:group>~/Controls/ViewItemsGroup.ascx</ext:group>
  <ext:dependencies>
    <cfg:dependency>My.Theme</cfg:dependency>
    <cfg:dependency>My.Commands</cfg:dependency>
  </ext:dependencies>
  <ext:apply>
    <ext:view name="DashboardView">
      <ext:control id="DashboardToolbar" />
    </ext:view>
    <ext:view name="PageView">
      <ext:control id="ItemToolbar" />
    </ext:view>
  </ext:apply>
</ext:extension>
于 2012-07-27T07:02:51.743 回答