我有一个Sitecore中的页面编辑器的自定义体验按钮,它引用了自定义命令。从这个上下文中打开SPEAK对话框的正确方法是什么?应该如何设置对话框的宽度/高度?从WebEdit命令打开时,Sitecore设置SPEAK UI对话框大小
我有以下命令代码:
public class MySpecialCommand : Sitecore.Shell.Applications.WebEdit.Commands.WebEditCommand
{
public override void Execute(Sitecore.Shell.Framework.Commands.CommandContext context)
{
var parameters = new NameValueCollection();
//add various parameters etc
Context.ClientPage.Start((object) this, "Run", parameters);
}
protected void Run(ClientPipelineArgs args)
{
if (!args.IsPostBack)
{
string url = "/sitecore/client/your%20apps/somespeakdialog?sc_lang=en&someParam" + args.Parameters["someParam"];
SheerResponse.ShowModalDialog(url, "100", "200", string.Empty, true);
args.WaitForPostBack();
}
else if (args.HasResult)
{
//not got this far yet...
}
}
}
,我发现对话框的大小没有任何相似之处到width
和height
参数传递给SheerResponse.ShowModalDialog
。我也尝试传递后缀为“px”的值,但这没有帮助。
您使用的是什么版本的Sitecore?我刚刚在8中试过了你的代码,它正确地呈现了Sheer对话框,并且它的高度为 – 2015-03-25 20:00:45
。我目前在7.5上,但由于这只是一个概念证明,所以我可以考虑升级到8.我注意到你提到过纯粹的对话框 - 我正在使用SPEAK UI对话框,所以这里可能有一些区别? – 2015-03-25 20:28:54
您正在使用SheerResponse.ShowModalDialog,因此它是纯粹的,Sitecore仍然部分地使用Sheer和SPEAK,这是其中一个实例。如果它是一个概念验证,它会为您节省8个麻烦 – 2015-03-25 21:26:57