Examples

Static Menu Example

settings.py

ADMINLTE2_MENU = [
    {
        'text': 'Home',
        'nodes': [
            {
                'route': 'adminlte2_pdq:home',
                'text': 'Home',
                'icon': 'fa fa-dashboard',
            },
            {
                'route': 'adminlte2_pdq:demo-css',
                'text': 'Demo CSS',
                'icon': 'fa fa-file'
            },
        ]
    },
    {
        'text': 'Profile',
        'nodes': [
            {
                'route': 'password_change',
                'text': 'Change Password',
                'icon': 'fa fa-lock'
            }
        ]
    },
    {
        'text': 'Samples',
        'nodes': [
            {
                'route': 'adminlte2_pdq:sample1',
                'text': 'Sample1',
                'icon': 'fa fa-group',
            },
            {
                'text': 'Sample Tree',
                'icon': 'fa fa-leaf',
                'nodes': [
                    {
                        'route': 'adminlte2_pdq:sample2',
                        'text': 'Sample2',
                        'icon': 'fa fa-building',
                    },
                ],
            },
        ],
    },
]
Site with static menu using settings

Dynamic and Static Menu Example

settings.py

ADMINLTE2_MENU = [
    {
        'text': 'Home',
        'nodes': [
            {
                'route': 'adminlte2_pdq:home',
                'text': 'Home',
                'icon': 'fa fa-dashboard',
            },
            {
                'route': 'adminlte2_pdq:demo-css',
                'text': 'Demo CSS',
                'icon': 'fa fa-file'
            },
        ]
    },
]

urls.py

urlpatterns = [

    path('dynamic/', views.dynamic, name="dynamic"),
    ...
]

views.py

def dynamic(request):
    """Show default dynamic page"""

    dynamic_content = [
        {
            'text': 'Dynamic Stuff',
            'nodes': [
                {
                    'route': 'dynamic',
                    'text': 'Dynamic',
                    'icon': 'fa fa-circle',
                },
            ]
        },
    ]

    return render(
        request,
        'dynamic.html',
        {
            'ADMINLTE2_MENU_FIRST': dynamic_content
        }
    )

dynamic.html

{% extends "adminlte2/base.html" %}
{% load i18n %}
{% block breadcrumbs %}
<ol class="breadcrumb">
    {% include "admin/partials/_breadcrumb_home.html" %}
    <li>
        {% trans 'Dynamic' %}
    </li>
</ol>
{% endblock breadcrumbs %}
{% block content %}
<h1>This is the Dynamic page!</h1>
{% endblock content %}
Site with static and dynamic menu using settings and context