Bootstrap Library

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:

  1. Correct Browser Support issues, installing respond.js.
  2. Update your Bootstrap version over your current theme options.
  3. 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

  1. Download Boostrap files on /libraries/bootstrap.
  2. Configure on which pages you want to load the libraries (by default everything but admin/*).
  3. Configure on which themes you want to load the libraries.

or

  1. On your theme root run composer require drupal/bootstrap_library
  2. Choose load libraries "locally composer"
  3. 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

    1. Download Boostrap files on /sites/all/libraries/bootstrap.
    2. Install and enable Boostrap Library Module.
    3. Configure on which pages you want to load the libraries (by default everything but admin/*).
    4. Configure on which themes you want to load the libraries.

    Compatibility with Bootstrap Theme

    This module is fully compatible with the Bootstrap Theme.

    Mantainers of this distribution:

Sponsored by:

Supporting organizations: 
Pay for the time spended on the modules mantainance

Project information

Releases