如何在每个页面中呈现django-cms插件? [英] How to render django-cms plugin in every page?

查看:319
本文介绍了如何在每个页面中呈现django-cms插件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个最新的django-cms新闻插件。



我想在页脚中显示5条最新消息。



如何在每个页面上呈现此插件?

解决方案

有一些模板标签可以帮助您实现您要做的工作:

  %占位符footer继承%} 

应从层次结构中的页面继承其内容,或者可以通过

  {%show_placeholderfooterhome%} 

您还可以组合使用

  {%placeholderfooteror%} 
{%show_placeholderfooterhome
{%endplaceholder%}
pre>

通常会从页面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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆