如何在每个页面中呈现django-cms插件? [英] How to render django-cms plugin in every page?
问题描述
我想在页脚中显示5条最新消息。
如何在每个页面上呈现此插件?
有一些模板标签可以帮助您实现您要做的工作:
%占位符footer继承%}
应从层次结构中的页面继承其内容,或者可以通过
{%show_placeholderfooterhome%}
您还可以组合使用
{%placeholderfooteror%}
pre>
{%show_placeholderfooterhome
{%endplaceholder%}
通常会从页面home中呈现占位符footer的内容,但如果将某些内容放在当前页面的占位符中,则会将其呈现内容!
I have a latest news plugin for django-cms.
I want to show 5 latest news in footer. Footer placed in every page of site.
How i can render this plugin in every page?
解决方案There are some template tags that should help you achieve what you are trying to do:
{% placeholder "footer" inherit %}
should inherit its content from pages above in the hierarchy, or you can render a place holder from another page with
{% show_placeholder "footer" "home" %}
you can also make a combination like
{% placeholder "footer" or %} {% show_placeholder "footer" "home" %} {% endplaceholder %}
which will normally render the contents of the placeholder "footer" from page "home", but if you place something in the placeholder of the current page it will render this content!
这篇关于如何在每个页面中呈现django-cms插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!