views:

407

answers:

1

I try to use django-treemenus. http://code.google.com/p/django-treemenus/

I create a tree menu (and menu item) using the admin interface. When I try to load menus using show_meny tag ( below you find my template where I call this tag).

I think I need to call treemenus/menu.html ( given in the sample to start) , but I don't know how? shoold I modify my 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 %}

A: 

Found your question while looking for the answer to a different treemenu question and I think I'm (just barely) qualified to answer.

The answer is no, you don't need to modify your TEMPLATE_DIRS. You do need to create a treemenus directory inside your template directory and inside that put a menu.html and menu_item.html. You will find examples of both of those in the docs directory of the django-treemenus distribution.

golliher

related questions