我一直在下面GUI扩展和通知示例使用两种_isEnabled或isEnabled,没有下划线.两者似乎都可以扩展或可能替换现有功能.
例如,PowerTools基类(似乎不"扩展"现有功能)具有:
PowerTools.BaseCommand.prototype.isEnabled = function(selection, pipeline)
{
var p = this.properties;
if (!p.initialized)
{
this.initialize();
}
if (!this.isToolConfigured())
{
return false;
}
if (this.isValidSelection)
{
return this.isValidSelection(selection, pipeline);
}
return true;
};
Run Code Online (Sandbox Code Playgroud)
工具可以使用此基类并声明.isValidSelection,例如:
PowerTools.Commands.CountItems.prototype.isValidSelection =
function (selection) { ... }
Run Code Online (Sandbox Code Playgroud)
我看到Anguilla ._isEnabled用于现有功能(在代码中的许多地方的Chrome控制台中).例如,WhereUsed有:
Tridion.Cme.Commands.WhereUsed.prototype._isAvailable =
function WhereUsed$_isAvailable(selection) ...
Run Code Online (Sandbox Code Playgroud)
我熟悉前面的下划线是私有变量的命名约定._isEnabled和其他以下划线"私有"开头的函数是什么?如果是的话,那么
我假设相同的方法适用于以下划线开头的其他函数,例如_isAvailable,和_invoke.
我创建了一个usercontrol,它有两个按钮,一个在另一个下面
<%@ 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>
Run Code Online (Sandbox Code Playgroud)
在extension.config中,我引用了usercontrol,如下所示.
<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>
</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>
Run Code Online (Sandbox Code Playgroud)
我是否还需要在extension.config中包含我的按钮详细信息(在ID之类的usercontrol中提到)?是否需要添加到<ext:command> ---- </ext:command> 任何其他地方.
创建的usercontrol,我只是放在extension.config,.js中,并在我的extension.config文件中引用ascx.我是否需要将usercontrol放在任何其他文件夹中?
我需要在tridion功能区中创建一个在另一个下面的按钮.
我创建了一个usercontrol,它出现在功能区上但处于禁用模式.在"http://tridiondeveloper.com/ribbon-item-group"; 有人提到<ext:issmallbutton>true</ext:issmallbutton>在配置中包含我的扩展元素.我已将它包含在extension.config文件中.但我面临的错误如"加载扩展失败 - 有无效的子元素'issmallbutton'.所以,目前我忽略了这一步,按钮处于禁用模式.
你可以让我知道我需要在哪里添加这个.(<ext:issmallbutton>true</ext:issmallbutton>)并启用按钮.