Getting started: adding Bootstrap to a database/ application

Update: the preferred way to include all the required Bootstrap files in every application is to use the Extension Library. The article below is kept for reference.

Bootstrap consists of a number of CSS and JavaScript files and a couple of images. The easiest way to add all of those to an application is by adding them to the WebContent folder:

  • Open the Package Explorer and navigate to your application
  • Right-click on the WebContent folder and choose Import > General > File System
  • Select the location where you've extracted the Bootstrap files to import them

I always create a folder called bootstrap in the WebContent folder first.

If you're using Windows you can also drag-n-drop the files right into the WebContent folder.

The files and folders you imported can now be referenced using a URL that’s relative to the root of the application/ database.

Bootstrap contains a number of components that rely on jQuery, so you should add jQuery to your application too using the same method.

The WebContent folder will eventually look similar to this:

Next, go into the application properties and set the HTML Doctype for your application to HTML5. This is required by Bootstrap.

Finally, add the Bootstrap CSS and JavaScript to all pages, either by adding them as 'resources' to an XPage(s)/ Custom control or by creating a "theme" in your application. A basic Bootstrap theme could look like this:

<theme xmlns:xsi="" xsi:noNamespaceSchemaLocation="platform:/plugin/" >

	<!-- meta tags -->
            <content>width=device-width, initial-scale=1.0</content>
	<!-- jquery -->
	<!-- bootstrap js -->
	<!-- bootstrap css-->

A list with all the files needed for Bootstrap to work can be found here.