删除Sitecore发布警告

Kas*_*ghe 1 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.
Run Code Online (Sandbox Code Playgroud)

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

Mar*_*idy 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>
Run Code Online (Sandbox Code Playgroud)

您可以在此处找到John West关于如何为此管道编写新警告的帖子.