我創建了以下我可以看到按鈕出現在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