我创建了以下我可以看到按钮出现在Sitecore的在http://jondjones.com/how-to-add-a-custom-sitecore-button-to-the-editor-ribbon/Sitecore的自定义功能区按钮不起作用
提到的步骤的自定义功能区按钮:
命令不会被触发时点击按钮。
下面是我的代码:
using System;
using Sitecore.Shell.Applications.Dialogs.ProgressBoxes;
using Sitecore.Shell.Framework.Commands;
namespace SitecoreVsPoc.Commands
{
public class TranslateContent : Command
{
private static readonly object Monitor = new object();
public override void Execute(CommandContext context)
{
if (context == null)
return;
try
{
ProgressBox.Execute("Arjun", "Title", "Applications/32x32/refresh.png", Refresh);
}
catch (Exception ex)
{
Sitecore.Diagnostics.Log.Error("Error!", ex, this);
}
}
public void Refresh(params object[] parameters)
{
// Do Stuff
}
}
}
下面是我在commands.config注册的命令:
<command name="contenteditor:translatecontent" type="SitecoreVsPoc.Commands.TranslateContent,SitecoreVsPoc" />
注:我使用Sitecore的8.2初始版本。
有人可以提出一个解决方案吗?
您可以确认是否在Sitecore中的按钮的Click字段中放置了'contenteditor:translatecontent'? – Adrian