【发布时间】:2016-12-10 16:50:03
【问题描述】:
我有两个文件,base.html 和 homepage.html。主页扩展基础,并添加到块extra。 Base 应该在 body 的 span 中渲染块 extra,但不会。
base.html:
{% load sekizai_tags %}
<!doctype html>
<html>
<head>
<title>Title</title>
</head>
<body>
<span style="color: red;">{% render_block "extra" %}</span>
{% block 'content' %}
{% endblock %}
</body>
</html>
主页.html:
{% extends 'base.html' %}
{% load sekizai_tags %}
{% block 'content' %}
<p>that's some sweet content ya got there lad</p>
{% addtoblock "extra" %}wow{% endaddtoblock %}
{% endblock %}
还有输出:
我错过了什么真正简单的事情?
【问题讨论】:
标签: django django-cms django-sekizai