【发布时间】:2012-02-17 11:00:07
【问题描述】:
也许我的做法完全错误......但我想做的是通过我所在的页面更改左侧导航。 base.html 中的左侧导航自始至终都很明显,但是一旦用户在 forums.html(扩展 base.html)上,我想更改左侧导航。
base.html:
{% if not no_left_bar %}
<div class="container">
<div class="row">
<!-- Left Side Bar -->
<nav>
original base.html nav goes here
</nav>
<!-- Some condition that goes here/ When forums.html -->
<nav>
forums.html( extends base.html ) nav goes here
</nav>
</div>
</div>
{% endif %}
我不知道我是否必须通过基本上下文传递它。感谢您的帮助和任何想法/建议。
【问题讨论】:
标签: django html django-templates django-context