Enabling Bootstrap

In order to use Bootstrap Widgets and Layouts, you need to enable Bootstrap in your web.config.py.

Note that you cannot use Bootstrap-based Widgets with older Pure or specially styled Reahl Widgets in the same project. If you enable Bootstrap, the others will cease to work correctly.

In order to enable Bootstrap, call enable_experimental_bootstrap() in your etc/web.config.py file:



from __future__ import print_function, unicode_literals, absolute_import, division
from reahl.doc.examples.tutorial.addressbook2bootstrap.addressbook2bootstrap import AddressBookUI

web.site_root = AddressBookUI
web.frontend_libraries.enable_experimental_bootstrap()

In examples thus far, you will often see a keyword argument style=’basic’ passed to a reahl.web.ui.HTML5Page. When using Bootstrap, refrain from doing this and ensure that you import all Widgets from modules underneath reahl.web.bootstrap.

When using Bootstrap, always import basic HTML Widgets from reahl.web.bootstrap.ui instead of from reahl.web.ui. This ensures you will get customised, stylised versions of Widgets where necessary – Widgets that are unchanged from reahl.web.ui are also available via reahl.web.bootstrap.ui so that you don’t need to differentiate.