Skip to main content

django-simplemenu-simplified

Cloned from https://github.com/althalus/django-simplemenu but make it more simple

A dead simple menu app for Django with ordering in admin interface and ability to link menu item with model instance, view or URL.

It features user-proof admin interface with links for ordering items and limited list of available pages to link to. You should register your views, QuerySets, model instances or URLs to populate that list.

Installation

  1. Run python setup.py install or just place simplemenu directory into a directory which is on your PYTHONPATH.

  2. Add 'simplemenu' to your INSTALLED_APPS setting.

  3. Run python manage.py syncdb.

  4. Register your pages by adding calls to simplemenu.register.

  5. Add menu to your templates.

Note that this application requires Django 1.1 or newer.

Templates

This app has only one tag:

{% get_simplemenu as [varname] %}

It stores QuerySet of all menu items in a context variable. Example:

{% load simplemenu_tags %}
{% get_simplemenu as menu %}
{% for item in menu %}
    <a href="{{ item.page.url }}">{{ item.name }}</a>
{% endfor %}

Highlight visited menu items

It’s relatively simple to handle menu item that links to current page. First, you need to have URL of the page in your template context. The most common way to do it is to add 'django.core.context_processors.request' to the TEMPLATE_CONTEXT_PROCESSORS setting and to use RequestContext in your views. Then you could write in your template the following:

{% load simplemenu_tags %}
{% get_simplemenu as menu %}
<ul>
{% for item in menu %}
    <li {% ifequal item.page.url request.path %}class="selected"{% endifequal %}>
        <a href="{{ item.page.url }}">{{ item.name }}</a></li>
{% endfor %}
</ul>

History

0.1.0 (2018-11-23)

  • First release on PyPI.

Metadata

Release files for django-simplemenu-simplified 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-simplemenu-simplified 2.0.1
File Size Uploaded Provenance Actions
django-simplemenu-simplified-2.0.1.tar.gz 11.3 kB Without provenance Details for django-simplemenu-simplified-2.0.1.tar.gz

Release files / django-simplemenu-simplified-2.0.1.tar.gz

Download URL django-simplemenu-simplified-2.0.1.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a7cf1ab5766cf18b6d171bdde23a3c19c59c1676efc45e33dcab3ee82689eeec
BLAKE2b-256 checksum
How to use checksums
46e40968d3522325bd059caab6c17316e84e07004ff95b1edee2f6df61cc76d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.3

Security for django-simplemenu-simplified 2.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page