{"id":23857414,"url":"https://github.com/ekaputra07/django-menuz","last_synced_at":"2025-07-14T17:14:48.986Z","repository":{"id":4057946,"uuid":"5161225","full_name":"ekaputra07/django-menuz","owner":"ekaputra07","description":"Drag and Drop Menu manager for Django. Mostly inspired by how menu creation in WordPress.","archived":false,"fork":false,"pushed_at":"2014-03-02T02:30:52.000Z","size":344,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-12-16T11:12:07.012Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ekaputra07.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-07-24T04:51:12.000Z","updated_at":"2023-05-16T08:59:43.000Z","dependencies_parsed_at":"2022-09-15T16:01:48.940Z","dependency_job_id":null,"html_url":"https://github.com/ekaputra07/django-menuz","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekaputra07%2Fdjango-menuz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekaputra07%2Fdjango-menuz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekaputra07%2Fdjango-menuz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekaputra07%2Fdjango-menuz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ekaputra07","download_url":"https://codeload.github.com/ekaputra07/django-menuz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232282734,"owners_count":18499328,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-03T02:54:58.918Z","updated_at":"2025-01-03T02:54:59.482Z","avatar_url":"https://github.com/ekaputra07.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"DJANGO MENUZ\n============\n\nDjango Menuz is another menu app for Django.\n\nIt mainly inspired by how easy menu creation ini WordPress. Django Menuz provides\ntemplate tags to call menu in specified location.\n\nWith it's drag and drop features, its easy to re-order the menu item position.\n\nINSTALLATION AND USAGE:\n-----------------------\nOnce you install it via setup.py, easy_install or pip.\n\n* Add ``menuz`` into your ``INSTALLED_APPS`` Django ``settings.py`` file.\n\n* Please make sure ``django.core.context_processors.request`` available in your ``TEMPLATE_CONTEXT_PROCESSORS``.\n\n* Also add url config below into projects urls configuration.\n  ::\n  \n    url(r'', include('menuz.urls')),\n\n* Register all available menu positions in project ``settings.py`` by adding ``AVAILABLE_MENUS`` parameter. example:\n  ::\n\n    AVAILABLE_MENUS = (\n    {\n        'id': 'top_menu',\n        'title': _('Top Menu'),\n        'type': 'UL',          #optional, default UL. alternative 'OL'\n        'class': 'someclass',  #optional, output: \u003cul class=\"ul_toplevel someclass\"\u003e\n        'before_link': 'BBB',  #optional, can be text or html tag. output: \u003cli\u003eBBB\u003ca href=\"...\"\u003eTitle\u003c/a\u003e\u003c/li\u003e\n        'after_link': 'AAA',   #optional, can be text or html tag. output: \u003cli\u003e\u003ca href=\"...\"\u003eTitle\u003c/a\u003eAAA\u003c/li\u003e\n    },\n\n    {\n        'id': 'footer_menu',\n        'title': _('Footer Menu'),\n        'type': 'UL',\n        'class': None,\n    },\n\n    {\n        'id': 'left_menu',\n        'title': _('Left Menu'),\n        'type': 'OL',\n        'class': None,\n    },\n    )\n\n* If you have few fix/static url into your application and want to include so it's will be selectable as a menu items, add ``AVAILABLE_INNERLINKS`` in your project ``settings.py``.\n  ::\n\n    AVAILABLE_INNERLINKS = (\n        ('/this_page/', 'This Page'),\n        ('/that_page/', 'That Page'),\n        ('/categories/', 'Categories Page'),\n        ('/collections/', 'Collections Page'),\n        ...\n        ...\n        etc.\n    )\n\n* Above links must inbound link, not links to other sites(outbound link).\n* For Outbound link menu, use Custom link in menu creation admin page.\n\nMODEL MENU\n----------\n\n* To create a menu based on Django model items, simply create ``menu.py`` in application directory, this is in the same level as application urls.py and register our model as following example (file: ``menu.py``).\n  ::\n\n    # file: menu.py\n    from menuz.registry import menuz\n    from catalog.models import Product\n\n    menuz.register(Product)\n\n* Or if you want to do some filtering before registering it into menuz do as follows (file: ``menu.py``).\n  ::\n\n    from menuz.registry import menuz\n    from catalog.models import Product\n\n    def active_product():\n        return Product.objects.filter(active=True)\n\n    menuz.register(Product, custom_source=active_product)\n\nWe registering extra callback that will be called when menuz will display selectable menu items in admin area,\nthat way, the menu item selector will not display all available products, but will display active products only.\n\nIMPORTANT:\n----------\nTo make Model menu items links correctly to its url, your model must utilize ``get_absolute_url()`` function. Because this is the only standard way to retrieve object urls, at least for django-menuz.\n\nexample:\n::\n\n    from django.db import models\n\n    class Page(models.Model):\n        title = models.CharField(max_length=50)\n        slug = models.SlugField()\n\n        @models.permalink\n        def get_absolute_url(self):\n            return ('some_page', None, {'slug': self.slug})\n\n\nCALLING MENU ITEMS IN TEMPLATE\n------------------------------\n**example calling menu items as html list**\n::\n\n    {% load 'menuz_tags' %}\n    {% list_menu 'top_menu' %}\n\n**example calling menu items as template context**\n\nThis implementation does not support hierarchical menu, please use ``list_menu`` tag if you need that feature.\n::\n\n    {% load menuz_tags %}\n    {% get_menu top_menu as tmenu %}\n\n    \u003ch2\u003e{{tmenu_title}}\u003c/h2\u003e\n    \u003cul\u003e\n        {% for item in tmenu %}\n        \u003cli\u003e\u003ca href=\"{{item.url}}\"\u003e{{item.title}}\u003c/a\u003e\u003c/li\u003e\n        {% endfor %}\n    \u003c/ul\u003e\n\nPlease note on the above example, when you assign a menu to a variable named ``somevar``, you can display the menu title by adding ``_title`` suffix after the variable name.\n\nIn the case above, the variable name is ``tmenu`` and the title will be available in variable named ``tmenu_title``.\n\nTESTING\n-------\nIn case you want to run a test for this app, you need to install Django-nose first https://pypi.python.org/pypi/django-nose (please refer to Django-nose docs on how to install).\n\nThen run the test by running command below:\n::\n\n  python manage.py test menuz","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fekaputra07%2Fdjango-menuz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fekaputra07%2Fdjango-menuz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fekaputra07%2Fdjango-menuz/lists"}