How to render django-cms plugin in every page?

风流意气都作罢 提交于 2019-12-03 05:13:35

问题


I have a latest news plugin for django-cms.

I want to show 5 latest news in footer. Footer placed on every page of site.

How can I render this plugin on every page?


回答1:


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!



来源:https://stackoverflow.com/questions/3616745/how-to-render-django-cms-plugin-in-every-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!