Context variables¶
Bambu Bootstrap recognises a number of context variables, passed in via a TemplateResponse object.
Their names are deliberately kept generic so as not to enforce a drastic change should you want to move away
from Bootstrap.
body_classes¶
A tuple of classes to add to the page’s <body> tag. Can be generated by the
body_classes decorator.
breadcrumb_trail¶
A two-tuple containing the URL and title of each item in a breadcrumb trail. The first item in the list should be the homepage, the last item (whose URL should be an empty string) should be the current page.
Example:
context['breadcrumb_trail'] = (
('../../', u'Home'),
('../', u'The parent page'),
('', u'This page')
)
This value is rendered by the breadcrumb_trail
template tag.
title_parts¶
A tuple that forms the text for a page’s <title> tag. The
bootstrap_title template tag
separates each part with a beam (|) character, and adds the name of the site to the end.
meta_keywords¶
Text for the value of a page’s <meta name="keywords"> tag.
meta_description¶
Text for the value of a page’s <meta name="description"> tag.
popup¶
Defines whether the current page is a popup window. Typically you’d set this context variable in a view
by checking for something in the querystring. If set, it adds popup to the list of classes in the
body tag.