Skip to content

Side menu does not load in custom template #464

Answered by SpaceShaman
SpaceShaman asked this question in Q&A
Discussion options

You must be logged in to vote

Okay, I solved this problem a bit around the corner.
I defined a function that returns a dictionary with menu items, and I creat an additional context processor for it.

def get_menu_list() -> Dict:
    """ Get menu list to use in side_menu admin template and index admin template. """
    menu_list = {}  # type: Dict[str, List]

    settings_head_icon = 'fas fa-cogs'
    menu_list['Settings'] = [
        {
            'name': 'Users',
            'changelist_url': reverse('admin:auth_user_changelist'),
            'icon': 'fas fa-user-cog',
            'head_icon': settings_head_icon,
            'view_permissions': ['auth.view_user']
        },
        {
            'name': 'Grups',
     …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by SpaceShaman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant