0
比方說,我有這樣的結構:如何覆蓋Django中包含的模板塊?
{# base.html #}
{% block content %}{% endblock %}
{# page.html #}
{% extends "base.html" %}
{% block content %}
{% include "snippet.html" %}
{# and I also want somehow to redefine {% block snippet_content %} of snippet here #}
{% endblock %}
{# snippet.html #}
<bells_and_whistles>
{% block snippet_content %}{% endblock %}
</bells_and_whistles>
我希望代碼是自我解釋。
有沒有一種優雅的方式來實現這一目標?