From 5e08ab85db41b31342aa3b0589bd0dac6896d4d4 Mon Sep 17 00:00:00 2001 From: Dominik George <nik@naturalnet.de> Date: Mon, 16 Nov 2020 23:03:41 +0100 Subject: [PATCH] Add documentation for related_views --- docs/menugeneration.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/menugeneration.rst b/docs/menugeneration.rst index 32c8ee9..69cee42 100644 --- a/docs/menugeneration.rst +++ b/docs/menugeneration.rst @@ -11,6 +11,7 @@ Django Menu Generator uses python dictionaries to represent the menu items, usua "url": URL spec, "root": True | False, "related_urls": [ list of related URLs ], + "related_views": [ list of related views ], "validators": [ list of validators ], "submenu": Dictionary like this } @@ -25,6 +26,8 @@ Where each key is as follows: - ``related_urls``: If one of this URLs is part of the path on the currently opened page, the menu item will be marked as selected (format of URLs like described at :doc:`urls`) + - ``related_views``: If the currently opened page resolves to one of these views, the menu item will be marked as selected. + - ``root``: A flag to indicate this item is the root of a path, with this you can correctly mark nested menus as selected. - ``validators``: See :doc:`validators` @@ -89,4 +92,4 @@ With this feature you can have a project structure like this:: │ ... -You can have a mix of the two approaches if you wish \ No newline at end of file +You can have a mix of the two approaches if you wish -- GitLab