创建“新闻” cmsplugin_blog Django CMS 应用程序部分
如何创建通用“新闻”部分,该部分将使用 cmsplugin_blog 并显示在所有页面上。是否可以告诉 Django CMS 在 base.html 中将应用程序包含在所有页面上?每个新闻条目的内容应显示在页面的主块中。
我的 base.html 看起来像这样:
...
{% block base_content %}
{% endblock %}
...
{% block right-column %}
{% endblock %}
每个页面的右栏中都应该有一个新闻简短列表,其中包含指向各个新闻条目的链接,当单击该链接时,这些新闻条目应该显示在基本内容块中。
How do I create a generic 'News' section, that would use cmsplugin_blog and be displayed on all pages. Is it possible to tell Django CMS in base.html to include the app on all pages? The content of each news entry should be displayed in the main block of the page.
My base.html looks something like this:
...
{% block base_content %}
{% endblock %}
...
{% block right-column %}
{% endblock %}
Each page that should have a news short list in the right column with links to individual news entries that should be displayed in the base content block when clicked on the link.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以执行此操作的一种方法是创建一个已发布但不在导航中的页面,并将博客插件的实例添加到该页面,然后在您的“主”模板中您可以显示该占位符的内容(这将是博客插件实例)使用以下模板标签:
http://django-cms.readthedocs.org/en/latest/advanced/templatetags.html#show-placeholder
One way you could do this would be to create a page which is published but not in the navigation and add an instance of the blog plugin to that page and then in your "master" template you can display the contents of that placeholder (which will be the blog plugin instance) using the following template tag:
http://django-cms.readthedocs.org/en/latest/advanced/templatetags.html#show-placeholder