【发布时间】:2009-11-04 11:14:03
【问题描述】:
我尝试使用 django-treemenus。 http://code.google.com/p/django-treemenus/
我使用管理界面创建了一个树形菜单(和菜单项)。 当我尝试使用 show_meny 标签加载菜单时(您可以在下面找到我称之为此标签的模板)。
我想我需要调用 treemenus/menu.html(在示例中给出开始),但我不知道怎么做?我应该修改我的 TEMPLATE_DIRS 吗?
{% extends "polls/base.html" %}
{% block title %}Poll list{% endblock %}
{# we override the block content here#}
{% block content %}
**{% load tree_menu_tags %}
{% show_menu "home" "vertical" %}**
{% if object_list %}
<ul>
{% for poll in object_list %}
<li>{{ poll.question }} at [ {{poll.pub_date|date:"F j, Y"}}]</li>
{% endfor %}
</ul>
{% else %}
<p>No polls are available.</p>
{% endif %}
{% endblock %}
【问题讨论】:
标签: django-templates