我的行为真的很奇怪。如果找到解决方案或只是提供建议如何找到它,我将不胜感激。
我有sitecore项目的结构:
以下是几种情况:
2
anubody知道为什么会发生这种情况吗?为什么"链接1"没有在第一个案例中发表?
答案 0 :(得分:0)
这是一个已知的错误。或者至少,您描述的症状与我们在这里遇到的完全一致。
不幸的是,Sitecore尚未正式发布该修补程序的知识库文章。您需要打开Sitecore支持票证。作为参考,修补程序#是436732。
答案 1 :(得分:0)
最后,我能够使用EventHandler修复此问题进行发布:结束 - 如果发布项目的项目类型为“test 2”,则以编程方式启动publich
的web.config:
<event name="publish:end">
<handler type="YourProject.Infostructure.EventHandlers, YourProject.Infostructure" method="OnPublishEnd" />
</event>
事件处理程序:
public void OnPublishEnd(object sender, EventArgs args)
{
Publisher publisher = Event.ExtractParameter(args, 0) as Publisher;
if (publisher != null && publisher.Options.Mode == PublishMode.SingleItem && publisher.Options.RootItem.TemplateID == IMicrositeLandingPageConstants.TemplateId &&
publisher.Options.Deep)
{
var item =
publisher.Options.RootItem.Children.FirstOrDefault(
i => i.TemplateID == IContentFolderConstants.TemplateId);
if (item != null)
{
//PUBLISH
PublishOptions publishOptions =
new PublishOptions(item.Database,
Database.GetDatabase("web"),
Sitecore.Publishing.PublishMode.SingleItem,
item.Language,
System.DateTime.Now); // Create a publisher with the publishoptions
Publisher publisher2 = new Publisher(publishOptions);
// Choose where to publish from
publisher2.Options.RootItem = item;
// Publish children as well
publisher2.Options.Deep = true;
publisher2.Publish();
}
}
}