Part of the Bootstrap ecosystem · 46 projects
This module provides a way to easily manage and load Bootstrap CSS and JavaScript libraries on your Drupal site. It allows you to use local or CDN versions of Bootstrap, supporting different development and production needs, and can be configured to load on specific pages or for particular themes.
Drupal 8 is here!!
Drupal 8 version includes local libraries as well as external CDN libraries.
Drupal 8 version of the module does not depend on libraries module.
This module loads via libraries , regardless of the theme you are using. It does nothing else.
When using Bootstrap themes is particularly helpful to:
- Correct Browser Support issues, installing respond.js.
- Update your Bootstrap version over your current theme options.
- Advanced CDN files loading.
This module does not depend on a specific version of Bootstrap, it just load the version you install, with the components you install on it, either complete or customize.
Installation Drupal 8
- Download Boostrap files on /libraries/bootstrap.
- Configure on which pages you want to load the libraries (by default everything but admin/*).
- Configure on which themes you want to load the libraries.
or
- On your theme root run
composer require drupal/bootstrap_library - Choose load libraries "locally composer"
- Download Boostrap files on /sites/all/libraries/bootstrap.
- Install and enable Boostrap Library Module.
- Configure on which pages you want to load the libraries (by default everything but admin/*).
- Configure on which themes you want to load the libraries.
Advanced
Code snipped for Drupal 8, to activate the library version directly on your module (hook_page_attachments()) or theme (hook_preprocess_page()):
<?php
if (\Drupal::moduleHandler()->moduleExists('bootstrap_library')) {
$library = theme_get_setting('bootstrap_barrio_library');
switch ($library) {
case 'cdn' :
$variables['#attached']['library'][] = 'bootstrap_library/bootstrap-cdn';
break;
case 'production':
$variables['#attached']['library'][] = 'bootstrap_library/bootstrap';
break;
case 'development':
$variables['#attached']['library'][] = 'bootstrap_library/bootstrap-dev';
break;
}
}
?>Installation Drupal 7
Compatibility with Bootstrap Theme
This module is fully compatible with the Bootstrap Theme.
Mantainers of this distribution:
Sponsored by:
Ask your assistant about Bootstrap Library
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
More in the Bootstrap ecosystem
Most installed first