Templates

This is where the main heart of Bambu Bootstrap can be found.

Error pages

These two templates handle Django’s 404 and 500 error pages in a friendly manner. They’re meant to be copied and messed with, so grab them from the source code and amend them, or just roll your own.

404.html

A Bootstrap-themed 404 Not Found page.

500.html

A Bootstrap-themed 500 Internal Server Error page.

Forms

See the Forms section for more information.

field.inc.html

An individual field row, with error checking and handling of various different styling scenarios.

form.inc.html

A rendered form, using the context variable form. By default the form is rendered in Bootstrap’s ‘vertical’ style, but you can use the horizontal style by adding style='horizontal' in your include statement.

Blocks:

  • non_field_errors: A list of general form errors, not relating to specific fields, rendered using Bootstrap’s alert classes.
  • fields: The list of fields (except for the DELETE field, ie: when used as part of a fieldset). By default, this block is rendered by looping through the visible fields in the form and including the field.inc.html template.
  • fieldset: Houses the DELETE field for a form within a formset
  • hidden_fields: The remaining, invisible fields of the form

Elements

Here are a few miscellaneous elements

bootstrap/base.inc.html

The engine room. This template includes the HTML5 doctype and tags. Your own base template should extend this one, using blocks to fill in the content.

Blocks:

  • title: The title tag for a page (see the bootstrap_title template tag for more information)
  • meta_tags: The meta tags for a page
  • extra_head: Where your base template should place its <head> tag content
  • after_header: The first thing displayed after the navigation bar
  • messages: The block that includes the bootstrap/messages.inc.html template
  • breadcrumb_trail: The block that includes the bootstrap/breadcrumb.inc.html template
  • content: Where the main page content lives
    • page_header: The content for the Bootstrap .page-header element
    • form_content: The primary (left-hand) column of content
    • sidebar: The (right-hand) sidebar
    • form_footer: The element to display after the form-content and sidebar
  • pre_footer: Appears straight after the main content block
  • footer: Appears inside a <footer> tag, and includes the bootstrap/footer.inc.html template
  • javascript: The area to place all JavaScript content that is safe to include at the bottom of a page

bootstrap/breadcrumb.inc.html

A breadcrumb bar. See the context variable or template tag for more information.

bootstrap/messages.inc.html

Bootstrap-themed alert boxes for messages generated by django.contrib.messages.

bootstrap/scripts.inc.html

Includes the jQuery and Bootstrap script tags. Use the BOOTSTRAP_JS_URL setting to provide your own Bootstrap script.

bootstrap/styles.inc.html

Includes the Bootstrap and Font Awesome CSS link tags Use the BOOTSTRAP_CSS_URL setting to provide your own Bootstrap theme.

bootstrap/typekit.inc.html

Includes the TypeKit script tag. See the TYPEKIT_KEY setting.