Skip to main content

Extensible, hierarchical, and pluggable navigation system for Django sites

Project description

django-treenav

Extensible, hierarchical, and pluggable navigation system for Django sites

Features

  • Generic functionality with multiple URL specifications: get_absolute_url(), reverse(), or raw URLs

  • Packaged with templates to render the tree hierarchy with nested <ul>’s, but can easily be overridden with custom templates

  • Useful css classes for flexible UI customization

  • Automatically sets “active” on item and item’s parents if PATH_INFO is equal to item.href

  • Efficient: minimizes database access with django-mptt functionality

Requirements

Installation

  1. Download the app through SVN and add it to your Python path:

svn co http://django-treenav.googlecode.com/svn/trunk/treenav treenav
  1. Add to your INSTALLED_APPS and run syncdb

INSTALLED_APPS = (
    ...,
    'mptt',
    'treenav',
)

Setup

  1. Login to the admin and build your menu item hierarchy

  2. Load the treenav_tags in your template and render the menu, e.g.

    {% load treenav_tags %}
    {% show_treenav 'primary-nav' %}
  3. Add treenav urls into your url patterns, e.g.

    (r'^%streenav/' % settings.URL_PREFIX, include('treenav.urls.admin')),

Test Suite

The treenav.tests package is set up as an application which holds a test settings module and defines models for use in testing django-trenav. You can run the tests from the command-line while specifying the test settings module:

./manage.py test --settings=treenav.tests.settings

Development sponsored by Caktus Consulting Group, LLC.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-treenav-0.5.0.tar.gz (11.2 kB view details)

Uploaded Source

File details

Details for the file django-treenav-0.5.0.tar.gz.

File metadata

File hashes

Hashes for django-treenav-0.5.0.tar.gz
Algorithm Hash digest
SHA256 f93b1011e420542b02e43718d175cb44f449ee07ab395d8b7c85f5ea00040306
MD5 b1b235300cb109e474be6dea1b84ea34
BLAKE2b-256 f15447722f529888e69a5e53f4045cd71ca6d440eef7604c4ff7cb33db29b596

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page