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:

topbar
Default:False

Boolean that decides whether to display the Top Bar or not.

leftmenu
Default:False

Boolean that decides whether to display the Left Menu or not.

rightmenu
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 the app_url defined.

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 any app_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.

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.

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.

top_bar_menu

Allows you to add links to the Top Bar. This is only visible when topbar is True. Intended to be used with the menu_item template tag.

top_bar_right_menu

Allows you to add links to the Top Bar on the right. This is only visible when topbar is True. Intended to be used with the menu_item template tag.

user_info_menu

Allows you to add links to the Top Bar in the user info dropdown. This is only visible when topbar and show_user_info are True. Intended to be used with the menu_item template tag.

left_menu

Allows you to add content to the Left Menu. This is only visible when leftmenu is True. Intended to be used with the menu_section template tag.

right_menu

Allows you to add links to the Right Menu. This is only visible when rightmenu is True. Intended to be used with the menu_section template tag.

breadcrumbs

Allows you to define breadcrumb links. See the Breadcrumbs documentation for more detail.