【发布时间】:2013-10-08 09:46:53
【问题描述】:
我正在尝试在我的模板中呈现一个占位符,我已将其放入自定义 CMS 插件中。问题是它告诉我“render_placeholder”标签是无效的块标签。
这是带有“render_placeholder”标签的模板。
{% extends 'base.html' %}
{% block base_content %}
<h2>Posts</h2>
{% if posts %}
{% for post in posts %}
<div class="entry-list">
{{ post.posted|date:"M d" }}
<h3><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></h3>
{% render_placeholder post.body %}
<a href="{{ post.get_absolute_url }}">Read More</a>
</div>
{% endfor %}
{% else %}
<p>There are no posts.</p>
{% endif %}
{% endblock %}
这是显示“{% load placeholder_tags %}”的基本模板。
{% load placeholder_tags cms_tags sekizai_tags static menu_tags %}
<html>
<head>
{% render_block "css" %}
<link href="{{ STATIC_URL }}css/styles.css" rel="stylesheet">
</head>
<body>
{% show_menu 0 100 100 100 %}
{% cms_toolbar %}
{% placeholder base_content %}
{% block base_content %}{% endblock %}
{% render_block "js" %}
</body>
</html>
它一直告诉我“无效的块标签:'render_placeholder',预期为'empty'或'endfor'”。
我错过了什么愚蠢的东西吗?
提前致谢。
【问题讨论】:
标签: python django django-templates django-cms