我的内容编辑抱怨,因为他们编辑的内容不是立即在浏览器中更新,而是让他们的工作变得艰难。
我在umbracosettings.config中尝试了以下内容无效:
<settings>
<content>
<XmlContentCheckForDiskChanges>true</XmlContentCheckForDiskChanges>
<ContinouslyUpdateXmlDiskCache>True</ContinouslyUpdateXmlDiskCache>
我有哪些选择?
备注:
我从遍历节点的控制器进行调用,如下所示:
public class HomePageController : RenderMvcController
{
private IServices services;
public HomePageController(IServices services)
{
this.services = services;
}
public override ActionResult Index(RenderModel model)
{
var viewModel = this.services.PageService.GetByID(CurrentPage.Id),
//
return View("~/Views/MVC/Page/Home.cshtml", viewModel);
}
以及根节点上的服务遍历:
/// <summary>
/// The root node is required in getting content by document type.
/// </summary>
protected IPublishedContent RootNode {
get
{
if( this.contentRootNode == null )
{
this.contentRootNode = this.umbracoHelper.TypedContentAtRoot().First();
}
return this.contentRootNode;
}
}
protected IEnumerable<IPublishedContent> GetPublishedContent(string documentTypeAlias)
{
IEnumerable<IPublishedContent> publishedContent = this.RootNode.Descendants().Where(x => x.DocumentTypeAlias == documentTypeAlias);
return publishedContent;
}