{ "info": { "author": "Julien Phalip", "author_email": "jphalip@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.5", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "=================\r\nDjango Tree Menus\r\n=================\r\n\r\n.. image:: https://travis-ci.org/jphalip/django-treemenus.png\r\n\r\nThis is a simple and generic tree-like menuing system for Django_ with an\r\neasy-to-use admin interface. It covers all the essentials for building\r\ntree-structured menus and should be enough for a lot of projects.\r\nIt is also easily extendable if you need to add some special behaviour to\r\nyour menu items.\r\n\r\ndjango-treemenus works with Django 1.0 and above and with python 2.5 and above.\r\n\r\n.. _Django: http://www.djangoproject.com/\r\n\r\nInstallation\r\n============\r\n\r\nInstalling an official release\r\n------------------------------\r\n\r\ndjango-treemenus is available on PyPI, and can be installed using Pip::\r\n\r\n pip install django-treemenus\r\n\r\nAlternatively, official source releases are made available at https://pypi.python.org/pypi/django-treemenus\r\n\r\nDownload the .zip distribution file and unpack it. Inside is a script\r\nnamed ``setup.py``. Run this command::\r\n\r\n python setup.py install\r\n\r\n...and the package will install automatically.\r\n\r\nInstalling the development version\r\n----------------------------------\r\n\r\nIf you prefer to update Django Tree Menus occasionally to get the latest bug\r\nfixes and improvements before they are included in an official release, do a\r\ngit clone instead::\r\n\r\n git clone https://github.com/jphalip/django-treemenus\r\n\r\nThen add the ``treemenus`` folder to your PYTHONPATH or symlink (junction, if\r\nyou're on Windows), such as in your Python's ``site-packages`` directory.\r\n\r\nHooking Tree Menus to your project\r\n----------------------------------\r\n\r\n1. Add ``treemenus`` to the ``INSTALLED_APPS`` setting of your\r\n Django project.\r\n\r\n2. Create django-treemenus tables by running the following command from the\r\n root of your project::\r\n\r\n python manage.py syncdb\r\n\r\n3. Create and add your custom templates to your project template folder. These\r\n templates are necessary to specify how you want your menus to be displayed\r\n on your site (See further below for more details on the use of templates).\r\n Some sample templates are also provided in the package to get you started.\r\n\r\nBasic use\r\n=========\r\n\r\nTo build a menu, log into the admin interface, and click \"Menus\" under\r\nthe Treemenus application section, then click \"Add menu\". Give your new\r\nmenu a name and then save.\r\n\r\nThen, to create menu items, click on your menu in the menu list. You will\r\nthen see a table in the bottom part of the page with only one item: the\r\nmenu's root. Click \"Add an item\", select its parent (obviously, since this\r\nis the first item you're creating you can only select the root). Fill out\r\nthe item's details and click \"Save\". The new item now shows up in the table.\r\nNow keep going to build the whole structure of your tree menu by creating as\r\nmany branches as you like.\r\n\r\nWhen you've finished building your menu from the admin interface, you will\r\nhave to write the appropriate templates to display the menu on your site\r\n(see below).\r\n\r\nTemplates used by django-treemenus\r\n==================================\r\n\r\nThe views included in django-treemenus use two templates. You need to create\r\nyour own templates into your template folder or any folder referenced in the\r\n``TEMPLATE_DIRS`` setting of your project.\r\n\r\n``treemenus/menu.html``\r\n-----------------------\r\n\r\nTemplate to specify how to display a menu.\r\n\r\n**Context:**\r\n\r\n* ``menu``\r\n Pointer to the menu to display. You can access its root item with\r\n ``menu.root_item``.\r\n\r\n* ``menu_type`` (optional)\r\n This variable will only be present if it has been specified when\r\n calling the ``show_menu`` template tag. (See the \"Template tags\"\r\n section for more details).\r\n\r\n**Example for this template**::\r\n\r\n {% load tree_menu_tags %}\r\n\r\n {% ifequal menu_type \"unordered-list\" %}\r\n