feincms applicationcontent 不适用于 feincms_translatedpage_or_base
我已使用文档中示例中的代码,但我无法使 ApplicationContent 在翻译后的页面上显示任何内容。
ApplicationContent 位于基本语言页面和翻译页面上,但它仅显示在基本语言页面上。
这些区域被渲染成这样:
{% feincms_translatedpage_or_base for feincms_page as feincms_transpage language=LANGUAGE_CODE %}
{% feincms_render_region feincms_transpage "main" request %}
有人知道这是为什么吗?
I have used the code from the examples in the docs, but I cannot make ApplicationContent show anything on a translated page.
The ApplicationContent is on both the base-language-page and the translated page, but it only shows up on the base-language-page.
The regions are being rendered like this:
{% feincms_translatedpage_or_base for feincms_page as feincms_transpage language=LANGUAGE_CODE %}
{% feincms_render_region feincms_transpage "main" request %}
Does anyone have any idea as to why this is?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,仅渲染内容不足以让 ApplicationContent 执行和/或显示任何操作。
必须提前确定内容块列表,以便可以对提供这些方法的所有内容类型调用 process() 和 Finalize() (fe ApplicationContent.process)。
如果您想从主翻译继承内容,您必须使用自定义的 _inherit_from 方法编写自己的 ContentProxy 子类。请注意,此方法没有记录,但如果没有充分的理由,它可能不会消失。
Yes, merely rendering the content is not sufficient for ApplicationContent to do and/or show anything.
The list of content blocks has to be determined earlier so that process() and finalize() can be called on all content types offering these methods (f.e. ApplicationContent.process).
If you want to inherit content from the main translation you'd have to write your own ContentProxy subclass with a customized _inherit_from method. Please note that this method is undocumented, it probably wont go away without a very good reason though.