删除Sitecore发布警告

时间:2013-09-12 08:15:15

标签: sitecore

当Sitecore用户打开一个未处于工作流程最终状态的项目时,在黄色背景上的“快速信息”区域顶部显示

If you publish now, the selected version will not be visible on the Web site because it is not in the final workflow step.

有没有办法可以避免在某些工作流程状态下的项目发生这种情况。

1 个答案:

答案 0 :(得分:5)

生成此警告的代码位于<getContentEditorWarnings>管道中。虽然我同意严;只因为你可以,并不意味着你应该 - 这将是你需要去的地方。我不确定那里的哪个处理器会产生你的特定警告,但是你可以用Reflector进行挖掘,或者只是逐一评论它们直到它消失为止。

您更有可能希望在此处对特定步骤进行编码,以根据您描述的业务规则生成警告。

Pipeline看起来像这样(在Sitecore 7中)

<getContentEditorWarnings>
  <processor type="Sitecore.Pipelines.GetContentEditorWarnings.ItemNotFound, Sitecore.Kernel" />
  <processor type="Sitecore.Pipelines.GetContentEditorWarnings.CanReadLanguage, Sitecore.Kernel" />
  <processor type="Sitecore.Pipelines.GetContentEditorWarnings.HasNoVersions, Sitecore.Kernel" />
  <processor type="Sitecore.Pipelines.GetContentEditorWarnings.CanWrite, Sitecore.Kernel" />
  <processor type="Sitecore.Pipelines.GetContentEditorWarnings.CanWriteWorkflow, Sitecore.Kernel" />
  <processor type="Sitecore.Pipelines.GetContentEditorWarnings.CanWriteLanguage, Sitecore.Kernel" />
  <processor type="Sitecore.Pipelines.GetContentEditorWarnings.IsReadOnly, Sitecore.Kernel" />
  <processor type="Sitecore.Pipelines.GetContentEditorWarnings.IsLocked, Sitecore.Kernel" />
  <processor type="Sitecore.Pipelines.GetContentEditorWarnings.HasNoFields, Sitecore.Kernel" />
  <processor type="Sitecore.Pipelines.GetContentEditorWarnings.NeverPublish, Sitecore.Kernel" />
  <processor type="Sitecore.Pipelines.GetContentEditorWarnings.ItemPublishingRestricted, Sitecore.Kernel" />
  <processor type="Sitecore.Pipelines.GetContentEditorWarnings.VersionPublishingRestricted, Sitecore.Kernel" />
  <processor type="Sitecore.Pipelines.GetContentEditorWarnings.ShowingInputBoxes, Sitecore.Kernel" />
  <processor type="Sitecore.Pipelines.GetContentEditorWarnings.FeedIsEmpty, Sitecore.Kernel" />
  <processor type="Sitecore.Pipelines.GetContentEditorWarnings.RunRules, Sitecore.Kernel" />
  <processor type="Sitecore.Pipelines.GetContentEditorWarnings.Notifications, Sitecore.Kernel" />
</getContentEditorWarnings>

您可以在John West上找到有关如何为此管道here编码新警告的帖子。