From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png

Release status:Extension status stable

ImplementationTemplate:Extension#type Parser extension
DescriptionTemplate:Extension#description Aims to provide editors with an easy access to certain components introduced by Twitter Bootstrap 3
Author(s)Template:Extension#username (oetterertalk)
Latest versionTemplate:Extension#version 1.2.1 (2018-02-22)
MediaWikiTemplate:Extension#mediawiki 1.27+
PHPTemplate:Extension#php 5.6
Database changesTemplate:Extension#needs-updatephp No
ComposerComposer mediawiki/bootstrap-components
LicenseTemplate:Extension#license GNU General Public License 3.0 or later

  • $wgBootstrapComponentsDisableSourceLinkOnImageModal
  • $wgBootstrapComponentsEnableCarouselGalleryMode
  • $wgBootstrapComponentsModalReplaceImageTag
  • $wgBootstrapComponentsWhitelist
see components.md
Hooks usedTemplate:Extension#hook

Translate the BootstrapComponents extension if it is available at translatewiki.net

Check usage and version matrix.

The BootstrapComponents extension provides editors with an easy access to certain components introduced by Twitter Bootstrap 3.

Note Note: This extension requires the Extension:Bootstrap on version 1.2 or later to be installed. Using composer to install BootstrapComponents will take care of this.


There are two ways you can install this extension: you can use Composer for installation, activation, and dependency management or you can do this all manually.


This is the easiest and recommended approach. Just add the following to the "require"-section of your composer.local.json file and run the php composer.phar install/update "mediawiki/bootstrap-components" command.

	"require": {
		"mediawiki/bootstrap-components": "~1.0"


You need to download and activate the extension yourself. Also, you need to take care of dependencies.

  • First, you should take care of dependencies. That means installing the MediaWiki Extension Bootstrap. See there for details on how to do this.
  • Then you need to download this extension, by cloning its repository using git. Venture into your extensions directory and run:
git clone https://github.com/oetterer/BootstrapComponents

You can also download the archive and extract it yourself.

Note that getting the extension manually from GitHub leaves you with the must current version of the extension.

  • Finally, you need to add the following to your LocalSettings.php file:
wfLoadExtension( 'BootstrapComponents' );


You can change some of the behaviour of this extension with the following four settings inside your wiki's configuration. Just add the corresponding line to your "LocalSettings.php" file.


Default setting is true.

This allows you to enable all, some, or none of the components inside your wiki code.

If you want all components available, set this to true:

$wgBootstrapComponentsWhitelist = true;

If you want only a selection of components, set this to an array containing the whitelisted components. For a list of all components, please refer to the documentation.

$wgBootstrapComponentsWhitelist = [ 'icon', 'panel', 'tooltip', 'modal' ];

When using modals, you might want to disable popovers. See known issues for more.

To disable all components simply set this to false.


Default setting is false.

You can have this extension change the normal image handling in your wiki. If you set this to true, all image tags not containing a link= parameter will be converted into a modal. So when you click on the image, instead of being referred to the corresponding page in the file namespace, a modal opens up showing the image with a possible caption (if you provided one) and a link to the source page of the file.


$wgBootstrapComponentsModalReplaceImageTag = true;

Most regular options that can be used with images are recognized and processed accordingly. Please see the help page for images.

Even after enabling this option you can suppress image modals on a given page by adding the magic word __NOIMAGEMODAL__ somewhere on the page. If you want to suppress modal conversion for an individual image, give it the css class no-modal.


[[File:NormalImage.png|class=no-modal|alt=normal|This image is displayed normally]]

Please see known issues for additional information.


Default setting is false.

When using image modals (thus having $wgBootstrapComponentsModalReplaceImageTag set to true) enabling this suppresses the source link in the footer section of the modal.


Default setting is true.

This adds the mode carousel to the <gallery>-tag which, when used turns your gallery into a carousel. For Information on how to use galleries, please see the gallery documentation.


See also[edit]