Base Template¶
nuit/base.html
¶
The base template contains the necessary markup to provide the basic framework elements and styling, and include the CSS and Javascript required for the Nuit interface to function. Most of the time, unless you’re using one of the generic templates listed below, you’ll be extending from nuit/base.html
and overwriting the various blocks you require.
Arguments¶
The following arguments can be passed to the extend tag to change the behaviour of the base template:
Default: False
Boolean that decides whether to display the Left Menu or not.
Default: False
Boolean that decides whether to display the Right Menu or not.
-
app_title
¶ Default: None
The name of the application. This is displayed in various places, such as the
<title>
element, and as a button on the top bar to take you back to theapp_url
defined.
-
app_logo
¶ Default: None
A more complex application title or logo that can contain HTML elements. This is displayed in a button on the top bar to take you back to the
app_url
defined, and overrides anyapp_title
defined in this location.app_title
is still used in the<title>
element.
-
app_url
¶ Default: None
The base view of the application - this should be a url-reversable string.
Default: False
Whether to display the breadcrumbs or not. See the Breadcrumbs documentation for more detail.
-
topbar_classes
¶ Default: None
A string containing extra classes to apply to the top bar for this particular page.
-
show_user_info
¶ Default: False
Boolean that decides whether to show the login information on the top right or not.
-
show_search
¶ Default: False
Boolean that decides whether to show the search box on the top right or not.
-
search_view
¶ Default: NUIT_SEARCH_VIEW
The view which the search form submits to.
-
search_placeholder
¶ Default: NUIT_SEARCH_PLACEHOLDER
The placeholder text for the search box.
-
search_parameter
¶ Default: NUIT_SEARCH_PARAMETER
The name of the search parameter.
Blocks¶
The following blocks can be overridden in subsequent templates to customise the content of the template - override these using the standard Django template model:
{% block block_name %}
This is my new content
{% endblock %}
title¶
Defines the title of the page, used in the <title>
element.
content¶
The main content of the page. The space that this content fills will be determined by the topbar
, leftmenu
and rightmenu
attributes.
head¶
Allows you to insert content into the <head>
of the page.
css¶
Allows you to enter CSS <link>
or <style>
elements that will be inserted into the <head>
element.
scripts¶
Allows you to enter Javascript <script>
tags that will be included just before the closing </body>
element.
breadcrumbs¶
Allows you to define breadcrumb links. See the Breadcrumbs documentation for more detail.