Skip to content

Commit

Permalink
Ability to choose sidebar by context variable
Browse files Browse the repository at this point in the history
Added ability to choose which sidebar should be rendered (defaults to
`default` by specifying `toolbox_sidebar_name` context variable.
  • Loading branch information
gbdlin committed Jun 15, 2020
1 parent 58dec42 commit 650ff46
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion admin_toolbox/templatetags/admin_toolbox_sidebar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 650ff46

Please sign in to comment.