DataFactory.GetChildren 在页面上返回零结果,但在 CMS 中不返回
我有一个奇怪的问题,在将 EPiServer CMS 6 升级到 EPiServer CMS 6 R2 后开始出现。
DataFactory.Instance.GetChildren(page.ParentLink);
当我在实际站点上运行上面的代码时,它不会返回任何子项,但当我使用编辑器模式并浏览到该页面时,我得到 36 个结果(这是正确的)。数据工厂适用于网站上的所有其他位置,并且它非常适合瑞典语网站,但它不适用于任何其他语言。我应该指出,在站点升级到 CMS 6 R2 之前,这适用于所有语言。
我需要那些孩子!有什么想法吗?
I have an odd issue that started appearing after upgrading EPiServer CMS 6 to EPiServer CMS 6 R2.
DataFactory.Instance.GetChildren(page.ParentLink);
The above code returns no children when I run it on the actual site but when I'm using the Editor mode and browse to the page, I get 36 results (which is correct). The datafactory works every other place on the site and it works perfectly for the Swedish site, however it doesn't work for any other language. I should point out that this worked in all languages before the site upgrade to CMS 6 R2.
I need those children! Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是否针对这些语言发布了子页面?
这有帮助吗?它适用于 CMS 5,但原理是相同的。
http://labs. episerver.com/en/Blogs/Mari-Jorgensen/Dates/2009/2/Breaking-change-in-GetChildren/
Are the child pages published for those languages?
Does this help? It's for CMS 5 but the principle is the same.
http://labs.episerver.com/en/Blogs/Mari-Jorgensen/Dates/2009/2/Breaking-change-in-GetChildren/
通过在调用中指定语言分支也设法解决了这个问题。在 Epi 6 R2 之前不需要这样做,而且我仍然认为它在编辑器模式下工作但在实际站点上不工作很奇怪。
Managed to solve this by specifying the language branch in the call aswell. Didn't need to do this prior to Epi 6 R2 and I still think it's odd that it's working in Editor mode but not on the actual site.