Template Blocks

General

General template blocks:

<html> content

html_attribute

HTML <html> attributes.

Default:

{% block html_attribute %}lang="{% block html_lang %}{{ ADMINLTE_HTML_LANG }}{% endblock html_lang %}"{% endblock html_attribute %}
html_lang

HTML <html> lang attribute.

Default:

{{ ADMINLTE_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:

{% block body_attribute %}class="{% block body_class %}hold-transition {{ ADMINLTE_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

control_items

Control sidebar navigation items.

control_tabs

Control sidebar navigation tab contents.

Messages

Django messages alert boxes.

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.

login_logo_text

Login logo content.

Default:

<b>Admin</b>LTE
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 %}
                {{ form }}
            </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.

Default:

Sign in to start your session
login_form

Login form

{% block login_form %}
    <form method="POST">
        {% csrf_token %}
        {{ form }}
    </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.

register_logo_text

Register logo content.

Default:

<b>Admin</b>LTE
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 %}
                {{ form }}
            </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.

Default:

Register a new membership
register_form

Register form

{% block register_form %}
    <form method="POST">
        {% csrf_token %}
        {{ form }}
    </form>
{% endblock register_form %}
register_social_auth

Register social authentication links.

register_links

Register links.