Movatterモバイル変換


[0]ホーム

URL:


Jump to content
MediaWiki
Search

Extension:BootstrapComponents

From mediawiki.org
Translate this page
Languages:
MediaWiki extensions manual
BootstrapComponents
Release status: stable
ImplementationParser extension
DescriptionAims to provide editors with an easy access to certain components introduced byBootstrap 4
Author(s)Tobias Oetterer (Oetterertalk)
Latest version5.2.1 (2024-07-16)
MediaWiki1.39+
PHP8.0+
Database changesNo
Composermediawiki/bootstrap-components
LicenseGNU General Public License 3.0 or later
Download
README
RELEASE-NOTES
Example

  • $wgBootstrapComponentsDisableSourceLinkOnImageModal
  • $wgBootstrapComponentsEnableCarouselGalleryMode
  • $wgBootstrapComponentsModalReplaceImageTag
  • $wgBootstrapComponentsWhitelist

TheBootstrapComponents extension provides editors with easy access to certain components introduced byBootstrap 4.

Installation

[edit]

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

This extension requires theBootstrap extension on version 4.0 or later to be installed. Using composer to install BootstrapComponents will take care of this.

Composer

[edit]

This is the easiest and only recommended approach.

Just run the following command:

COMPOSER=composer.local.jsoncomposerrequiremediawiki/bootstrap-components"^5.0"

It will add the following tocomposer.local.json:

{"require":{"mediawiki/bootstrap-components":"^5.0"}}

Manually (Not recommended)

[edit]

You must download the extension on your own.Also, you need to take care of dependencies.

  • First, you should take care of dependencies. That means installing theBootstrap extension. See there for details on how to do this.
  • Then you need to download this extension by cloning its repository usinggit. Venture into your extensions directory and run:
gitclonehttps://github.com/oetterer/BootstrapComponents

You can also download thearchive and extract it yourself.

Activation

[edit]

Since release 4.0, you must manually enable the extension in your configuration.Previously, this would automatically be done by Composer.Please add the following line to yourLocalSettings.php:

wfLoadExtension('Bootstrap');wfLoadExtension('BootstrapComponents');

Configuration

[edit]

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

$wgBootstrapComponentsWhitelist

[edit]

Default setting istrue.

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

If you want all components available, set this totrue:

$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 thedocumentation.

$wgBootstrapComponentsWhitelist=['card','tooltip','modal'];

When using modals[1], you might want to disable popovers[2].Seeknown issues for more.

To disable all components simply set this tofalse.

$wgBootstrapComponentsModalReplaceImageTag

[edit]

Default setting isfalse.

This extension can change the normal image handling in your wiki.If you set this totrue, all image tags not containing alink= 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.

Example:

$wgBootstrapComponentsModalReplaceImageTag=true;

Most regular options that can be used with images are recognized and processed accordingly.Please see thehelp 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 classno-modal.

Example:

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

Please seeknown issues for additional information.

$wgBootstrapComponentsDisableSourceLinkOnImageModal

[edit]

Default setting isfalse.

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

$wgBootstrapComponentsEnableCarouselGalleryMode

[edit]

Default setting istrue.

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

Examples

[edit]

See also

[edit]
Supported skins
Dependencies
Other solutions

Notes

[edit]
  1. modal matches an element that is in a state in which it excludes all interaction with elements outside it until the interaction has been dismissed
  2. popover elements will appear above all other elements
This extension is included in the following wiki farms/hosts and/or packages:This is not an authoritative list. Some wiki farms/hosts and/or packages may contain this extension even if they are not listed here. Always check with your wiki farms/hosts or bundle to confirm.
Retrieved from "https://www.mediawiki.org/w/index.php?title=Extension:BootstrapComponents&oldid=7570019"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp