Extension:Bootstrap

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

Release status:Extension status stable

ImplementationTemplate:Extension#type Skin
DescriptionTemplate:Extension#description Provides the Twitter Bootstrap 3 web front-end framework
Author(s)Template:Extension#username Stephan Gambke (F.trotttalk)
Latest versionTemplate:Extension#version 1.1.4 (March 2015)
MediaWikiTemplate:Extension#mediawiki 1.22+
PHPTemplate:Extension#php 5.3+
Database changesTemplate:Extension#needs-updatephp No
ComposerComposer mediawiki/bootstrap
LicenseTemplate:Extension#license GNU General Public License 3.0 or later
Download see text
README on GitHub
Hooks usedTemplate:Extension#hook
SetupAfterCacheManual:Hooks/SetupAfterCache

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

Check usage and version matrix.

The Bootstrap extension provides the Twitter Bootstrap (version 3) web front-end framework to skins and extensions.

Installation[edit]

The Bootstrap extension requires Composer for installation. (But why!?)

  1. If not already done, install Composer.
  2. If not already done, copy composer-example.json to composer.json in your MediaWiki installation directory
  3. Run composer require "mediawiki/bootstrap:~1.0" (or php composer.phar require "mediawiki/bootstrap:~1.0" if applicable)
  4. Run composer update
  5. YesY Done – Navigate to "Special:Version" on your wiki to verify that the extension is successfully installed.


Remark: If you are upgrading from a version of this extension installed without using Composer, before running composer you need to first

  • Remove the old extension from the extensions directory
  • Remove the require_once "$IP/extensions/Bootstrap/Bootstrap.php"; from LocalSettings.php

Usage[edit]

Use \bootstrap\BootstrapManager::getBootstrapManager() to get the singleton managing the Bootstrap framework.

You can add modules using its methods addBootstrapModule(), addAllBootstrapModules(), and addExternalModule().

You can set LESS variables using setLessVariable() and setLessVariables().

Finally to add the Bootstrap styles and javascript to the page use $out->addModuleStyles( 'ext.bootstrap.styles' ) for styles only, $out->addModules( 'ext.bootstrap.scripts' ) for scripts only and $out->addModules( 'ext.bootstrap' ) for styles and javascript. For an example have a look at the Chameleon skin.

Contact[edit]

Comments, questions and suggestions should be sent or posted to:

See also[edit]

Directly related[edit]

Disambiguation[edit]

  • the BootStrap extension (note the exact spelling of the name!) aims to allow for the addition of Bootstrap styling within MediaWiki articles
  • the BootStrapSkin skin makes use of the BootStrap extension
  • the Bootstrap skin is another Bootstrap based skin independent from either extension