Template Blocks

General

<html> content

html_attribute

HTML <html> attributes.

Default:

<html {% block html_attribute %}lang="{% block html_lang %}{{ ADMINLTE_HTML_LANG }}{% endblock html_lang %}" {% endblock html_attribute %}>
html_lang

HTML <html> lang attribute.

Default:

{% block html_lang %}{{ ADMINLTE_HTML_LANG }}{% endblock html_lang %}

<head> content

meta

<meta> tags in <head>.

Default:

{% block meta %}
    {% include 'adminlte2/components/_meta.html' %}
{% endblock meta %}
title

HTML <title> tag text.

stylesheets

CSS links in <head>.

Default:

{% block stylesheets %}
    {% include 'adminlte2/components/_stylesheets/bootstrap.html' %}
    {% include 'adminlte2/components/_stylesheets/fontawesome.html' %}
    {% include 'adminlte2/components/_stylesheets/adminlte.html' %}
{% endblock stylesheets %}
favicon

Favicon links in <head>:

Default:

{% block favicon %}
    <link rel="shortcut icon" href="{% block favicon_icon %}{% static 'favicon.ico' %}{% endblock favicon_icon %}">
{% endblock favicon %}
favicon_image

Favicon image path.

Default:

<link rel="shortcut icon" href="{% block favicon_icon %}{% static 'favicon.ico' %}{% endblock favicon_icon %}">
shim

HTML 5 Shim JavaScript links in <head>.

Default:

{% block shim %}
    {% if ADMINLTE_USE_SHIM %}
        {% include 'adminlte2/components/_shim.html' %}
    {% endif %}
{% endblock shim %}
javascripts

JavaScript links in <head>.

Default:

{% block javascripts %}
    {% include 'adminlte2/components/_javascripts/jquery.html' %}
    {% include 'adminlte2/components/_javascripts/bootstrap.html' %}
    {% include 'adminlte2/components/_javascripts/adminlte.html' %}
{% endblock javascripts %}

<body> content

body

HTML <body> tag content.

body_attribute

HTML <body> attributes.

Default:

<body {% block body_attribute %}class="{% block body_class %}hold-transition {% block skin_style %}{{ ADMINLTE_SKIN_STYLE }}{% endblock skin_style %}{% endblock body_class %}"{% endblock body_attribute %}>
body_class

HTML <body> tag class attributes.

Default:

{% block body_class %}hold-transition {{ ADMINLTE_SKIN_STYLE }}{% endblock body_class %}
skin_style

HTML <body> tag class attribute for AdminLTE 2 skin theme.

Valid values are: 'skin-black', 'skin-black-light', 'skin-blue', 'skin-blue-light', 'skin-green', 'skin-green-light', 'skin-purple', 'skin-purple-light', 'skin-red', 'skin-red-light', 'skin-yellow', 'skin-yellow-light'.

javascripts_body

JavaScript links in <body>.

Layouts

Sidebar and top navigation layout template blocks:

Templates

header_template

AdminLTE 2 navigation header template.

Default:

{% block header_template %}
    {% include 'adminlte2/components/header.html' %}
{% endblock header_template %}
sidebar_template

AdminLTE 2 navigation sidebar template.

Default:

{% block sidebar_template %}
    {% include 'adminlte2/components/sidebar.html' %}
{% endblock sidebar_template %}
messages_template

Django messages alert box template.

Default:

{% block messages_template %}
    {% include 'adminlte2/components/messages.html' %}
{% endblock messages_template %}
control_template

AdminLTE 2 control sidebar template.

Default:

{% block control_template %}
    {% include 'adminlte2/components/control.html %}
{% endblock control_template %}

AdminLTE 2 footer template.

Default:

{% block footer_template %}
    {% include 'adminlte2/components/footer.html' %}
{% endblock footer_template %}

Content

content_template

AdminLTE 2 page content code.

Default:

{% block content_template %}
    <div class="content-wrapper">
        {% block content_wrapper %}
            {% block no_content_header %}
                <section class="content-header">
                    {% block content_header %}
                        {% block no_page_title %}
                            <h1>
                                {% block page_title %}{% endblock page_title %}
                                <small>{% block page_description %}{% endblock page_description %}</small>
                            </h1>
                        {% endblock no_page_title %}

                        {% block no_breadcrumbs %}
                            <ol class="breadcrumb">
                                {% block breadcrumbs %}{% endblock breadcrumbs %}
                            </ol>
                        {% endblock no_breadcrumbs %}
                    {% endblock content_header %}
                </section>
            {% endblock no_content_header %}

            {% block content_body %}
                <section class="content">
                    {% block messages_template %}
                        {% include 'adminlte2/components/messages.html' %}
                    {% endblock messages_template %}

                    {% block content %}
                    {% endblock content %}
                </section>
            {% endblock content_body %}
        {% endblock content_wrapper %}
    </div>
{% endblock content_template %}
content_wrapper

Page content <div class="content-wrapper"> code.

content_header

Page content header code. Contains the page title and description, and breadcrumb navigation.

Default:

{% block content_header %}
    {% block no_page_title %}
        <h1>
            {% block page_title %}{% endblock page_title %}
            <small>{% block page_description %}{% endblock page_description %}</small>
        </h1>
    {% endblock no_page_title %}

    {% block no_breadcrumbs %}
        <ol class="breadcrumb">
            {% block breadcrumbs %}{% endblock breadcrumbs %}
        </ol>
    {% endblock no_breadcrumbs %}
{% endblock content_header %}
no_content_header

Declare block as empty to remove page content header (page title and description, breadcrumb navigation):

{% block no_content_header %}{% endblock no_content_header %}
page_title

Page title text that will be displayed in the content header.

page_description

Page description text that will be displayed in the content header.

no_page_title

Declare block as empty to remove page title and description text:

{% block no_page_title %}{% endblock no_page_title %}
breadcrumbs

Breadcrumb navigation that will be displayed in the content header.

no_breadcrumbs

Declare block as empty to remove breadcrumb navigation:

{% block no_breadcrumbs %}{% endblock no_breadcrumbs %}
content_body

Page content body code. Contains the Django messages alert boxes and page main content.

Default:

{% block content_body %}
    <section class="content">
        {% block messages_template %}
            {% include 'adminlte2/components/messages.html' %}
        {% endblock messages_template %}

        {% block content %}
        {% endblock content %}
    </section>
{% endblock content_body %}
content

Page main content.

Control

Template blocks to customize the control component (adminlte2/components/control.html):

control_items

Control sidebar navigation items.

control_tabs

Control sidebar navigation tab contents.

Messages

Template blocks to customize the Django messages alert boxes component (adminlte2/components/messages.html):

message_debug

DEBUG alert box.

Default:

<div class="alert alert-info alert-dismissible">
    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
    {{ message }}
</div>
message_info

INFO alert box.

Default:

<div class="alert alert-info alert-dismissible">
    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
    {{ message }}
</div>
message_success

SUCCESS alert box.

Default:

<div class="alert alert-success alert-dismissible">
    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
    {{ message }}
</div>
message_warning

WARNING alert box.

Default:

<div class="alert alert-warning alert-dismissible">
    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
    {{ message }}
</div>
message_error

ERROR alert box.

Default:

<div class="alert alert-error alert-dismissible">
    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
    {{ message }}
</div>
message_default

Custom message alert box.

Default:

<div class="alert alert-info alert-dismissible">
    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
    {{ message }}
</div>

Pages

Login

login_logo

Login logo code.

Default:

{% block login_logo %}
    <div class="login-logo">
        <a href="{% block login_logo_href %}/{% endblock login_logo_href %}">
            {% block login_logo_text %}
                <b>Admin</b>LTE
            {% endblock login_logo_text %}
        </a>
    </div>
{% endblock login_logo %}
login_logo_href

Login logo link URL.

Defaults to /.

login_logo_text

Login logo content.

Default:

{% block login_logo_text %}
    <b>Admin</b>LTE
{% endblock login_logo_text %}
login_content

Login page main content code.

Default:

{% block login_content %}
    <div class="login-box-body">

        <p class="login-box-msg">
            {% block login_description %}
                Sign in to start your session
            {% endblock login_description %}
        </p>

        {% block login_form %}
            <form method="POST">
                {% csrf_token %}
                {% if next %}
                    <input type="hidden" name="next" value="{{ next }}">
                {% endif %}
                {% if form.non_field_errors %}
                    <div class="text-danger">
                        {{ form.non_field_errors }}
                    </div>
                {% endif %}
                {% for field in form %}
                    <div class="form-group {% if field.errors %}has-error{% endif %}">
                        {{ field.label_tag }}
                        {% if field.errors %}
                            <div class="text-danger">
                                {{ field.errors }}
                            </div>
                        {% endif %}
                        {{ field|add_class:'form-control' }}
                        {% if field.help_text %}
                            <p class="help-block">{{ field.help_text|safe }}</p>
                        {% endif %}
                    </div>
                {% endfor %}
                <button class="btn btn-primary" type="submit">Submit</button>
                <button class="btn btn-default" type="reset">Clear</button>
            </form>
        {% endblock login_form %}

        <div class="social-auth-links text-center">
            {% block login_social_auth %}
            {% endblock login_social_auth %}
        </div>

        {% block login_links %}
        {% endblock login_links %}
    </div>
{% endblock login_content %}
login_description

Login page description.

Defaults to Sign in to start your session.

login_form

Login form code.

Default:

{% block login_form %}
    <form method="POST">
        {% csrf_token %}
        {% if next %}
            <input type="hidden" name="next" value="{{ next }}">
        {% endif %}
        {% if form.non_field_errors %}
            <div class="text-danger">
                {{ form.non_field_errors }}
            </div>
        {% endif %}
        {% for field in form %}
            <div class="form-group {% if field.errors %}has-error{% endif %}">
                {{ field.label_tag }}
                {% if field.errors %}
                    <div class="text-danger">
                        {{ field.errors }}
                    </div>
                {% endif %}
                {{ field|add_class:'form-control' }}
                {% if field.help_text %}
                    <p class="help-block">{{ field.help_text|safe }}</p>
                {% endif %}
            </div>
        {% endfor %}
        <button class="btn btn-primary" type="submit">Submit</button>
        <button class="btn btn-default" type="reset">Clear</button>
    </form>
{% endblock login_form %}
login_social_auth

Login social authentication links.

login_links

Login links.

Register

register_logo

Register logo code.

Default:

{% block register_logo %}
    <div class="register-logo">
        <a href="{% block register_logo_href %}/{% endblock register_logo_href %}">
            {% block register_logo_text %}
                <b>Admin</b>LTE
            {% endblock register_logo_text %}
        </a>
    </div>
{% endblock register_logo %}
register_logo_href

Register logo link URL.

Defaults to /.

register_logo_text

Register logo content.

Default:

{% block register_logo_text %}
    <b>Admin</b>LTE
{% endblock register_logo_text %}
register_content

Register page main content code.

Default:

{% block register_content %}
    <div class="register-box-body">

        <p class="login-box-msg">
            {% block register_description %}
                Register a new membership
            {% endblock register_description %}
        </p>

        {% block register_form %}
            <form method="POST">
                {% csrf_token %}
                {% if form.non_field_errors %}
                    <div class="text-danger">
                        {{ form.non_field_errors }}
                    </div>
                {% endif %}
                {% for field in form %}
                    <div class="form-group {% if field.errors %}has-error{% endif %}">
                        {{ field.label_tag }}
                        {% if field.errors %}
                            <div class="text-danger">
                                {{ field.errors }}
                            </div>
                        {% endif %}
                        {{ field|add_class:'form-control' }}
                        {% if field.help_text %}
                            <p class="help-block">{{ field.help_text|safe }}</p>
                        {% endif %}
                    </div>
                {% endfor %}
                <button class="btn btn-primary" type="submit">Submit</button>
                <button class="btn btn-default" type="reset">Clear</button>
            </form>
        {% endblock register_form %}

        <div class="social-auth-links text-center">
            {% block register_social_auth %}
            {% endblock register_social_auth %}
        </div>

        {% block register_links %}
        {% endblock register_links %}
    </div>
{% endblock register_content %}
register_description

Register page description.

Defaults to Register a new membership.

register_form

Register form code.

Default:

{% block register_form %}
    <form method="POST">
        {% csrf_token %}
        {% if form.non_field_errors %}
            <div class="text-danger">
                {{ form.non_field_errors }}
            </div>
        {% endif %}
        {% for field in form %}
            <div class="form-group {% if field.errors %}has-error{% endif %}">
                {{ field.label_tag }}
                {% if field.errors %}
                    <div class="text-danger">
                        {{ field.errors }}
                    </div>
                {% endif %}
                {{ field|add_class:'form-control' }}
                {% if field.help_text %}
                    <p class="help-block">{{ field.help_text|safe }}</p>
                {% endif %}
            </div>
        {% endfor %}
        <button class="btn btn-primary" type="submit">Submit</button>
        <button class="btn btn-default" type="reset">Clear</button>
    </form>
{% endblock register_form %}
register_social_auth

Register social authentication links.

register_links

Register links.

Extras

Paginator

paginator_template

Paginator template

Default:

{% block paginator_template %}

<div class="{{ align }}">
    <ul class="{% block paginator_class %}pagination {% if no_margin %}no-margin{% endif %} {% endblock paginator_class %}">
        {% block paginator_content %}
            {% block first %}
                {% if show_first %}
                    <li>
                        <a href="?page=1">
                            {% block first_text %}<small>First</small>{% endblock first_text %}
                        </a>
                    </li>
                {% endif %}
            {% endblock first %}

            {% block prev %}
                {% if has_prev %}
                    <li>
                        <a href="?page={{ prev_page }}">
                            {% block prev_text %}<i class="fa fa-caret-left"></i>{% endblock prev_text %}
                        </a>
                    </li>
                {% endif %}
            {% endblock prev %}

            {% block pages %}
                {% for link_page in page_numbers %}
                    {% ifequal link_page current_page %}
                        {% block current %}
                            <li class="active">
                                <a href="?page={{ link_page }}">
                                    {% block current_text %}
                                        {{ current_page }}
                                    {% endblock current_text %}
                                </a>
                            </li>
                        {% endblock current %}
                    {% else %}
                        {% block link %}
                            <li>
                                <a href="?page={{ link_page }}">
                                    {% block link_text %}
                                        {{ link_page }}
                                    {% endblock link_text %}
                                </a>
                            </li>
                        {% endblock link %}
                    {% endifequal %}
                {% endfor %}
            {% endblock pages %}

            {% block next %}
                {% if has_next %}
                    <li>
                        <a href="?page={{ next_page }}">
                            {% block next_text %}
                                <i class="fa fa-caret-right"></i>
                            {% endblock next_text %}
                        </a>
                    </li>
                {% endif %}
            {% endblock next %}

            {% block last %}
                {% if show_last %}
                    <li>
                        <a href="?page=last">
                            {% block last_text %}<small>Last</small>{% endblock last_text %}
                        </a>
                    </li>
                {% endif %}
            {% endblock last %}
        {% endblock paginator_content %}
    </ul>
</div>

{% endblock paginator_template %}
paginator_class

Paginator element class names.

Default:

<ul class="{% block paginator_class %}pagination {% if no_margin %}no-margin{% endif %} {% endblock paginator_class %}">
paginator_content

Paginator main content code.

first

First page link code.

Default:

{% block first %}
    {% if show_first %}
        <li>
            <a href="?page=1">
                {% block first_text %}<small>First</small>{% endblock first_text %}
            </a>
        </li>
    {% endif %}
{% endblock first %}
first_text

First page link text.

Default:

{% block first_text %}<small>First</small>{% endblock first_text %}
prev

Previous page link code.

Default:

{% block prev %}
    {% if has_prev %}
        <li>
            <a href="?page={{ prev_page }}">
                {% block prev_text %}<i class="fa fa-caret-left"></i>{% endblock prev_text %}
            </a>
        </li>
    {% endif %}
{% endblock prev %}
prev_text

Previous page link text.

Default:

{% block prev_text %}<i class="fa fa-caret-left"></i>{% endblock prev_text %}
pages

Page number links code.

Default:

{% block pages %}
    {% for link_page in page_numbers %}
        {% ifequal link_page current_page %}
            {% block current %}
                <li class="active">
                    <a href="?page={{ link_page }}">
                        {% block current_text %}
                            {{ current_page }}
                        {% endblock current_text %}
                    </a>
                </li>
            {% endblock current %}
        {% else %}
            {% block link %}
                <li>
                    <a href="?page={{ link_page }}">
                        {% block link_text %}
                            {{ link_page }}
                        {% endblock link_text %}
                    </a>
                </li>
            {% endblock link %}
        {% endifequal %}
    {% endfor %}
{% endblock pages %}
current

Current page number link code.

Default:

{% block current %}
    <li class="active">
        <a href="?page={{ link_page }}">
            {% block current_text %}
                {{ current_page }}
            {% endblock current_text %}
        </a>
    </li>
{% endblock current %}
current_text

Current page number link text.

Default:

{% block current_text %}
    {{ current_page }}
{% endblock current_text %}
link

Adjacent page number link code.

Default:

{% block link %}
    <li>
        <a href="?page={{ link_page }}">
            {% block link_text %}
                {{ link_page }}
            {% endblock link_text %}
        </a>
    </li>
{% endblock link %}

Adjacent page number link text.

Default:

{% block link_text %}
    {{ link_page }}
{% endblock link_text %}
next

Next page link code.

Default

{% block next %}
    {% if has_next %}
        <li>
            <a href="?page={{ next_page }}">
                {% block next_text %}
                    <i class="fa fa-caret-right"></i>
                {% endblock next_text %}
            </a>
        </li>
    {% endif %}
{% endblock next %}
next_text

Next page link text.

Default:

{% block next_text %}
    <i class="fa fa-caret-right"></i>
{% endblock next_text %}
last

Last page link code.

Default:

{% block last %}
    {% if show_last %}
        <li>
            <a href="?page=last">
                {% block last_text %}<small>Last</small>{% endblock last_text %}
            </a>
        </li>
    {% endif %}
{% endblock last %}
last_text

Last page link text.

Default:

{% block last_text %}<small>Last</small>{% endblock last_text %}