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 theDELETEfield, 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 thefield.inc.htmltemplate.fieldset: Houses theDELETEfield for a form within a formsethidden_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 thebootstrap_titletemplate tag for more information)meta_tags: The meta tags for a pageextra_head: Where your base template should place its<head>tag contentafter_header: The first thing displayed after the navigation barmessages: The block that includes thebootstrap/messages.inc.htmltemplatebreadcrumb_trail: The block that includes thebootstrap/breadcrumb.inc.htmltemplatecontent: Where the main page content livespage_header: The content for the Bootstrap.page-headerelementform_content: The primary (left-hand) column of contentsidebar: The (right-hand) sidebarform_footer: The element to display after the form-content and sidebar
pre_footer: Appears straight after the main content blockfooter: Appears inside a<footer>tag, and includes thebootstrap/footer.inc.htmltemplatejavascript: 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.