From 650ff460039ce0399521114546ef85ff18611164 Mon Sep 17 00:00:00 2001 From: GwynBleidD Date: Mon, 15 Jun 2020 15:22:30 +0200 Subject: [PATCH] Ability to choose sidebar by context variable Added ability to choose which sidebar should be rendered (defaults to `default` by specifying `toolbox_sidebar_name` context variable. --- admin_toolbox/templatetags/admin_toolbox_sidebar.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/admin_toolbox/templatetags/admin_toolbox_sidebar.py b/admin_toolbox/templatetags/admin_toolbox_sidebar.py index 8576e82..8638b47 100644 --- a/admin_toolbox/templatetags/admin_toolbox_sidebar.py +++ b/admin_toolbox/templatetags/admin_toolbox_sidebar.py @@ -13,9 +13,10 @@ @register.inclusion_tag('admin_toolbox/sidebar.html', takes_context=True) -def admin_sidebar_content(context, menu_name='default'): +def admin_sidebar_content(context, menu_name=None): request = context.request + menu_name = menu_name or context.get('toolbox_sidebar_name') or 'default' config = settings.sidebar.get(menu_name)