Extension talk:Bootstrap
This page used the LiquidThreads extension to give structured discussions. It has since been converted to wikitext, so the content and history here are only an approximation of what was actually displayed at the time these comments were made. |
Examples files for beginning
Hi F.trott and thank you for this extension.
Could you help me to write a little "get started" text for beginners like me answering some questions like :
Which files are mandatory to use the bootstrap (I'm thinking about files that have to be in the skin directory...)?
Do you have any files for example ?
Thanks, Nicolas NALLET (talk) 18:59, 11 June 2013 (UTC)
- Hi Nicolas,
- the only mandatory thing for the Bootstrap extension is the Less extension. For an example on how to use the Bootstrap extension have a look at the Chameleon skin. The Bootstrap extension was created for that skin. It should be fairly straight forward to adapt that skin for your purposes.
- However, please be aware that both the Bootstrap extension and the Chameleon skin are work in progress and may change significantly. There are for example a few incompatibilities between Bootstrap and the rest of MediaWiki that need fixing.
- For an introduction into skinning have a look at the Skinning tutorial. I used it for the Chameleon skin and found it very useful.
- Cheers, F.trott (talk) 20:17, 11 June 2013 (UTC)
- Hi,
- Thanks for your answer that's what I needed.
- I tried using the chameleon skin but it doesnt work :
- http://www.paris.xn--smantique-b4a.com/index.php?title=Accueil
- despite less, bootstrap and chamelon appear on the Special:Version page :
- http://www.paris.xn--smantique-b4a.com/index.php?title=Sp%C3%A9cial:Version
- My conf :
- MediaWiki 1.20.6
- PHP 5.4.6 (cgi-fcgi)
- MySQL 5.5.14
- Any idea ? But I dont want to make you loose your time, I can wait for the beta version. Anyway Thanks for your work. Nicolas NALLET (talk) 22:14, 11 June 2013 (UTC)
- Ok, this is my fault. The download link given on the extension page for the Twitter Bootstrap package is wrong. Could you please try to download https://github.com/twitter/bootstrap/archive/master.zip and put the contents in the .../extensions/Bootstrap/bootstrap directory. You may have to adjust the directories a bit. In the end you should have in the .../extensions/Bootstrap/bootstrap directory the contents of the bootstrap-master directory contained in the zip file, e.g. docs, img, js and less directories and some files like LICENSE and Makefile. F.trott (talk) 10:21, 12 June 2013 (UTC)
- Hi,
- I downloaded the new files in the right folder
extensions/Bootstrap/bootstrap
- But it still doesnt work.
- I put in Localsettings the "require_once" sentences in this order (at the bottom) :
require_once( "$IP/extensions/Less/Less.php" );
require_once( "$IP/extensions/Bootstrap/Bootstrap.php" );
require_once( "$IP/skins/chameleon/chameleon.php" );
$wgDefaultSkin = "chameleon";
Nicolas NALLET (talk) 16:46, 12 June 2013 (UTC)- Ok, I do not really have a clue. Two things, that may or may not help:
- First, could you please remove the Chameleon.i18n.php and Chameleon.skin.php files from the skins directory?
- Second, to facilitate further debugging, could you please turn on error reporting on your wiki? E.g. add
error_reporting(E_ALL | E_STRICT);
ini_set("display_errors", 1);
- before the
require_once( "$IP/includes/DefaultSettings.php" );
- and
$wgShowExceptionDetails = true;
$wgDebugComments = true;
- after that line. F.trott (talk) 17:14, 12 June 2013 (UTC)
- Ok done,
- I can see now the sentence :
Notice: Constant CHAMELEON_VERSION already defined in /homez.149/comparatxu/www/ParisOpenData/skins/chameleon.php on line 44
Nicolas NALLET (talk) 08:31, 13 June 2013 (UTC)- Oh, yes, you have to remove that file, too. The chameleon skin is contained entirely in the skins/chameleon subdirectory. No other files necessary in the skins directory. F.trott (talk) 08:56, 13 June 2013 (UTC)
- ok done but still doesn't work... :( Nicolas NALLET (talk) 11:55, 13 June 2013 (UTC)
- There is now a problem with the Less extension. You need to move the Less/lessphp/lessphp directory one level up, so that the contents of the lessphp package end up in Less/lessphp. (I will fix the installation instruction for Less, too) F.trott (talk) 12:06, 13 June 2013 (UTC)
- It works thanks a lot !
- http://www.paris.sémantique.com
- Cheers Nicolas NALLET (talk) 14:49, 13 June 2013 (UTC)
- Finally! :)
- Thanks for trying this skin! And sorry for the hassle. If you play with it and have good ideas how it should be improved, please consider getting a developer account and submitting a patch. See Gerrit/Getting_started for a short guide to using Git and Gerrit for MediaWiki development. F.trott (talk) 14:58, 13 June 2013 (UTC)
- Ok I keep you in touch if I find good ideas.
- In which web sites are you testing it ?
- I saw this website that uses it : http://www.sindome.org/ do you know it ?
- Bye Nicolas NALLET (talk) 13:40, 14 June 2013 (UTC)
- There is now a problem with the Less extension. You need to move the Less/lessphp/lessphp directory one level up, so that the contents of the lessphp package end up in Less/lessphp. (I will fix the installation instruction for Less, too) F.trott (talk) 12:06, 13 June 2013 (UTC)
- ok done but still doesn't work... :( Nicolas NALLET (talk) 11:55, 13 June 2013 (UTC)
- Oh, yes, you have to remove that file, too. The chameleon skin is contained entirely in the skins/chameleon subdirectory. No other files necessary in the skins directory. F.trott (talk) 08:56, 13 June 2013 (UTC)
- I have the same error. All set, but the pattern is not displayed. Please write the full instructions on how you set the template? 108rub (talk) 04:53, 21 October 2013 (UTC)
- Install the extension
- Call
Bootstrap::getBootstrap()->addAllBootstrapModules()
- This has to be done in a place, that is run when
load.php
is run. I use the main skin entry file for that.
- This has to be done in a place, that is run when
- Call
$out->addModuleStyles( 'ext.bootstrap' )
to load the css- If you build a skin, this can be done in your subclass of
SkinTemplate
in thesetupSkinUserCss()
method
- If you build a skin, this can be done in your subclass of
- Call
$out->addModules( array( 'ext.bootstrap' ) )
to load the javascript
- I am not a programmer, there are step by step instructions? I do not know where to enter the codes. 108rub (talk) 11:52, 21 October 2013 (UTC)
- \Bootstrap\BootstrapManager::getInstance()->addAllBootstrapModules(); 178.168.59.167 17:08, 17 February 2015 (UTC)
- Ok, this is my fault. The download link given on the extension page for the Twitter Bootstrap package is wrong. Could you please try to download https://github.com/twitter/bootstrap/archive/master.zip and put the contents in the .../extensions/Bootstrap/bootstrap directory. You may have to adjust the directories a bit. In the end you should have in the .../extensions/Bootstrap/bootstrap directory the contents of the bootstrap-master directory contained in the zip file, e.g. docs, img, js and less directories and some files like LICENSE and Makefile. F.trott (talk) 10:21, 12 June 2013 (UTC)
Bootstrap 3
Currently, this doesn't work with Bootstrap 3. Parsing Bootstrap 3 with Less causes problems. The temporary solution is to use Bootstrap 2.x which you can download from http://getbootstrap.com/2.3.2/ or if you are using git
with the --recursive
option, you can then go to the /extensions/Bootstrap/bootstrap directory and run git checkout b4c4072679943773a7582daa63f545ba818fa627
and then git pull
.
I really hope the parser will be fixed soon, so one can use Bootstrap 3. Huji (talk) 21:04, 7 October 2013 (UTC)
- There are indeed problems with stock Bootstrap 3. However, see Extension:Bootstrap#Issues for a temporary workaround. Using Bootstrap 2 is not a solution, as it is incompatible with Bootstrap 3. F.trott (talk) 21:14, 7 October 2013 (UTC)
- Agreed. However, I couldn't get Extension:Bootstrap#Issuess to work. So I thought maybe I should share what I could get to work. Huji (talk) 22:20, 7 October 2013 (UTC)
- Yes, fiddling with git is always loads of fun. I think what I did in the end was to go to the bootstrap module's directory and do a
git remote set-url origin git@github.com:s7eph4n/bootstrap.git
followed by a normalgit pull
. - Then I went to the extensions directory (i.e. one up) and modified the .gitmodules file setting the url to https://github.com/s7eph4n/bootstrap.git.
- Will update the extension page with the procedure tomorrow. F.trott (talk) 22:31, 7 October 2013 (UTC)
- Yes, fiddling with git is always loads of fun. I think what I did in the end was to go to the bootstrap module's directory and do a
- Agreed. However, I couldn't get Extension:Bootstrap#Issuess to work. So I thought maybe I should share what I could get to work. Huji (talk) 22:20, 7 October 2013 (UTC)
Test page of the implemntation of Bootsrap 3 and chameleon skin on a MediaWIki website
Hi, I have created a test page on my wiki that uses Bootstrap and chameleon skin.
Some item work but some don't like Button, Collapse, Glyphicons or tooltip...
Do you achieve to make it work on your wiki ?
Thanks,
Cheers Nicolas NALLET (talk) 10:57, 5 December 2013 (UTC)
- Chameleon is a skin. There are some HTML tags, that are not allowed in MediaWiki, notably a, button and img. A skin can not change this.
- To set a class on images, use [[File:Logo-semantiki.png|class=img-responsive]] (without quotation marks).
- The glyphicons issue is fixed in the latest development version of Extension:Bootstrap. F.trott (talk) 15:26, 5 December 2013 (UTC)
Bootstrap in Vector Skin
First things first, thanks for the good work, Stephan. But I'm having a little trouble using the extension in Vector skin which comes with MediaWiki as default.
- The extension is installed and I can see it in Special:Version page.
- I added ext.bootstrap to addModules and addModuleStyles in correct places.
- I added Bootstrap::getBootstrap()->addAllBootstrapModules(); statement to the beginning of skins/Vector.php file.
I can see 2 ext.bootstrap phrases in the page source, where load.php is included as stylesheet and where mw.loader.load is called. But the stylesheet doesn't include any part of bootstrap as far as I can see, and none of bootstrap css works. I will appreciate your help with this situation Yigitozen (talk) 02:39, 9 December 2013 (UTC)
- Hello,
- this could have a lot of causes. You could turn on PHP error messages (Manual:How_to_debug#PHP_errors) and load the page in debug mode (i.e. append
debug=true
to the URL). Then use Firebug to see if the CSS is loaded correctly or if there are any errors reported. With the page in debug mode you could also look up the URL of the CSS in the page's HTML source and follow that link (in Firefox just hit Ctrl-U and click on URL in the <link> tag). - (Is your wiki public?) F.trott (talk) 16:15, 9 December 2013 (UTC)
- I'm not seeing any errors, all stylesheets are loaded but they don't include bootstrap.
- It is public: http://wiki.gamehonor.com/hearthstone Yigitozen (talk) 02:15, 12 December 2013 (UTC)
- I have no idea. I can not get it to work here locally either. I will investigate and come back to you. F.trott (talk) 10:40, 12 December 2013 (UTC)
- Ok, the problem is, that the Bootstrap styles are loaded by a call to load.php. Since on these calls no actual HTML pages are served, skins are not needed and thus skin files not loaded. This means, the call to
Bootstrap::getBootstrap()->addAllBootstrapModules();
will not be executed and the LESS compiler will just compile an empty file. - Solution: Put that call to
Bootstrap::getBootstrap()->addAllBootstrapModules();
where it will be executed, e.g. LocalSettings.php. F.trott (talk) 08:50, 13 December 2013 (UTC)
CSS gets loaded twice
The bootstrap style seems to load twice when loading a page:
- As a stylesheet-link going to load.php
- Included in a style-tag
Since Internet Explorer gives the style-tag a higher priority over styles that are added using common.css etc (if they don't have the important tag off course), this could mean styles are overridden.
If I look at other wikis using the bootstrap extension I'm seeing the same issue. Is this a bug or is there a problem while using the Chameleon-skin? JonaBrackenwood (talk) 15:07, 3 March 2014 (UTC)
- You could say it is a MW/ResourceLoader bug. Have not yet found a solution, but I am working on it. F.trott (talk) 15:08, 3 March 2014 (UTC)
- This should now be solved. You'll need latest dev versions of both Extension:Bootstrap and Skin:Chameleon. F.trott (talk) 17:13, 30 March 2014 (UTC)
Error installing using Composer
The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
Your requirements could not be resolved to an installable set of packages.
Problem 1 - The requested package mediawiki/bootstrap could not be found in any version, there may be a typo in the package name. Nischayn22 (talk) 15:47, 7 June 2014 (UTC)
- Could be that you need to allow composer to install dev packages. See https://www.mediawiki.org/wiki/Skin:Chameleon#Installation (item 3). F.trott (talk) 19:53, 10 June 2014 (UTC)
- I believe this is how the "composer.json" file has to be set up:
{ "require": { "php": ">=5.3.2", "mediawiki/bootstrap": "1.*@dev" }, "minimum-stability" : "dev", "prefer-stable" : true }
- Hope that this is it. By the way, neither MediaWiki (alpha) nor Cameleon provide a "composer-example.json" file. [[kgh]] (talk) 20:08, 11 June 2014 (UTC)
- That fixed it I guess. Thanks a lot! Nischayn22 (talk) 05:05, 12 June 2014 (UTC)
Is it possible to install new version of Bootstrap without shell access and so without composer ?
Thanks. Nicolas NALLET (talk) 14:29, 11 June 2014 (UTC)
- The easiest would probably be to put it on a local machine using composer and then upload the relevant directories (.../extensions/Bootstrap, .../vendor) F.trott (talk) 14:34, 11 June 2014 (UTC)
- This should work. One just has to make sure that the path is maiden. If you are using it eg. within an existing instance on a local machine it will not work. I have added a little docu to smw.o. [[kgh]] (talk) 15:46, 11 June 2014 (UTC)
- Well, if you want to install more than one package with composer, they should all be installed locally before uploading. Else you will run into problems with the autoloader. F.trott (talk) 15:52, 11 June 2014 (UTC)
- Exactly, at least this was what I tried to convey. :) [[kgh]] (talk) 15:59, 11 June 2014 (UTC)
- Thank you, I will try this workaround,
- Cheers Nicolas NALLET (talk) 09:37, 12 June 2014 (UTC)
- Exactly, at least this was what I tried to convey. :) [[kgh]] (talk) 15:59, 11 June 2014 (UTC)
- Well, if you want to install more than one package with composer, they should all be installed locally before uploading. Else you will run into problems with the autoloader. F.trott (talk) 15:52, 11 June 2014 (UTC)
- This should work. One just has to make sure that the path is maiden. If you are using it eg. within an existing instance on a local machine it will not work. I have added a little docu to smw.o. [[kgh]] (talk) 15:46, 11 June 2014 (UTC)
Does an example website of bootstrap skin?
If there is a link? thanks Snow8261 (talk) 06:32, 26 June 2014 (UTC)
- Please be aware that this is the talk page for the Extension Bootstrap, which is used by the Skin:Chameleon. The Skin Bootstrap is handled elsewhere. F.trott (talk) 06:36, 26 June 2014 (UTC)
No checkboxes in Bootstrap skin
Hi guys,
I'm using the Bootstrap skin for a small wiki. It looks and works great. The only problem is that it doesn't show checkboxes, for example the ones in the login screen and in Special:UserRights Does anybody have an idea how I can have working checkboxes while using the Bootstrap skin?
Thanks in advance,
Mark Superski (talk) 14:12, 8 July 2014 (UTC)
- Please be aware, that this is the discussion page for the Extension Bootstrap, which is unrelated to the Skin Bootstrap. However, if somebody can answer the question, please do so. F.trott (talk) 16:55, 18 July 2014 (UTC)
- I moved the thread because Superski linked the Bootstrap extension, not Skin:BootStrapSkin. Ricordisamoa 22:10, 18 July 2014 (UTC)
Extension:Bootstrap vs Extension:Bootstrap
I'm not sure what can be done about this but there appear to be (at least) two extensions called 'Extension:Bootstrap', i.e. the present one created by Stephan and a slightly ?older one by Andru Vallance, Daniel Schuba and Matt Yeh (https://github.com/mtyeh411/mediawiki-bootstrap). This is already cause for some confusion, since the page now links to https://wikiapiary.com/wiki/Extension:Bootstrap - which, in fact, refers to the other extension. To clear away the cobwebs, maybe you could come to some sort of arrangement? Cavila (MW 1.22, MySQL 5.5.37-0, Php 5.4.4-14 squeeze, SMW 1.9.2, SF 2.7) 09:06, 21 July 2014 (UTC)
- The one by Andru Vallance, Daniel Schuba and Matt Yeh is a skin. Have a look at the page you linked. F.trott (talk) 09:09, 21 July 2014 (UTC)
- It looks to me like a skin and an extension bundled together. Cavila (MW 1.22, MySQL 5.5.37-0, Php 5.4.4-14 squeeze, SMW 1.9.2, SF 2.7) 09:17, 21 July 2014 (UTC)
- This is a problem of Wikiapiary. Not of the Bootstrap extension, nor the Bootstrap skin.
- I already sent them a mail about it. F.trott (talk) 09:19, 21 July 2014 (UTC)
- Ok, thanks. Cavila (MW 1.22, MySQL 5.5.37-0, Php 5.4.4-14 squeeze, SMW 1.9.2, SF 2.7) 09:20, 21 July 2014 (UTC)
- Please see my reply on this at https://github.com/WikiApiary/WikiApiary/issues/176. I don't think this is a problem with WikiApiary, both a skin and extensions are returned via the MediaWiki API. 🐝 thingles (talk) 12:02, 22 July 2014 (UTC)
- It looks to me like a skin and an extension bundled together. Cavila (MW 1.22, MySQL 5.5.37-0, Php 5.4.4-14 squeeze, SMW 1.9.2, SF 2.7) 09:17, 21 July 2014 (UTC)
Unexpected non-MediaWiki exception encountered, of type "RuntimeException"
- Hi, I get this error once the plugin has been installed. I'm using the latest mediawiki version and extension version:
- Unexpected non-MediaWiki exception encountered, of type "RuntimeException"
- Anyone know what the problem is? —CraigyDavi TALK 14:08, 24 July 2014 (UTC)
- How did you install the extension? F.trott (talk) 14:42, 9 August 2014 (UTC)
- I had the same problem. Turned out that I had to allow "DROP" and "CREATE TEMPORARY TABLES" for the wiki's database user account in the SQL backend. It has to do with Semantic MediaWiki. See here. Gutesork (talk) 22:25, 4 February 2015 (UTC)
- I encountered same issue recently while I used Mediawiki downloaded via yum command in CentOS. Using official Mediawiki will be OK.;-> Staplecrab (talk) 13:41, 24 December 2015 (UTC)
Using bootstrap mixins
Thanks for an awesome extension.
I'm trying to register my own less file and use built-in mixins. Is there an easy way to import them using this extension? I'm attempting something like this:
.left-column { .col-lg-9; }
72.193.157.107 19:44, 11 August 2014 (UTC)
- In your skin or extension you need to get the Bootstrapmanager and then use it to add your file:
$bm = \Bootstrap\BootstrapManager::getInstance(); $bm->addExternalModule( $filename, $remotePath );
- The remote path is only necessary if you want to use relative urls in your less file, e.g. for images. Else you can just leave it away. F.trott (talk) 20:15, 11 August 2014 (UTC)
- Thanks. Unfortunately, I'm still getting:
/* LESS compile error: .col-lg-9 is undefined in ... .less */
72.193.157.107 20:41, 11 August 2014 (UTC)- Then I'll need some time to work out how exactly this worked. It's been some time... :/
- I'll get back to you. F.trott (talk) 20:43, 11 August 2014 (UTC)
- Ok, learned something new today. The problem is, that you can not use dynamically created classes as mixins. And all the col-*-* classes are dynamic.
- You can however use .make-lg-column(1) to create your CSS. (This will in fact create the CSS for a multi-column column of 1 columns width.) F.trott (talk) 22:31, 15 August 2014 (UTC)
- I am sorry about that. Your suggestion works well. Thank you for your patience. 72.193.157.107 00:23, 19 August 2014 (UTC)
Bootstrap and Chameleon
Hi, i'm trying to install Chameleon but it does not work. In LocalSettings.php I load bootstrap extention and Chameleon skin. Default skin is set to chameleon. However, when I load any wiki page I get a white screen without any error. Commenting 'Bootstrap' I get the error that Chameleon is depending on Bootstrap. Commenting 'chameleon' and leaving uncommented bootstrap produce again the white page; therefore something is not working in Bootstrap extension. Version is 1.1 downloaded from GIT. Any help?
Thanks 194.11.209.11 14:18, 24 November 2014 (UTC)
- Did you read the Chameleon installation instructions?
- Did you follow them? F.trott (talk) 14:43, 24 November 2014 (UTC)
- Yes, however I cannot use composer as my system is not connected to internet 79.30.113.1 19:38, 24 November 2014 (UTC)
- > Yes, however I cannot use composer as my system is not connected to internet
- So how did you mange to "Version is 1.1 downloaded from GIT"?
- Please, use a PC that has appropriate access, run Composer as described, and copy all files to the selected destination.
- PS: Using git to try to download dependencies is not sufficient and should be avoided otherwise you will introduce incompatibilities by mixing versions that might not work together (this is one reason why dependencies are defined). MWJames (talk) 19:52, 24 November 2014 (UTC)
- Yes, however I cannot use composer as my system is not connected to internet 79.30.113.1 19:38, 24 November 2014 (UTC)
RuntimeException: Failed to clone Bootstrap.git
This happnes whenever I try running the 'composer require' command. Following the "https://git.wikimedia.org/git/mediawiki/extensions/Bootstrap.git" link directly leads to a 404 page. Is this particulr file still available at another url or is it down for some other reason? Thanks in advance! 175.137.39.194 04:35, 18 December 2014 (UTC)
Do you have exemple of website using that Boostrap extension ?
Hi,
Do you have example(s) of website(s) using that Boostrap extension ?
Thanks. 82.238.74.57 17:25, 21 December 2014 (UTC)
- All wikis using the Chameleon skin. See usage data on Wikiapiary.
- There may be others, but I am not aware of them. F.trott (talk) 10:26, 22 December 2014 (UTC)
Fatal error: Cannot use object of type Closure as array in D:\xampp\htdocs\SNWiki\extensions\Bootstrap\src\Hooks\SetupAfterCache.php on line 119
Hello,
Mediawiki version 1.24 in windows platform
localsettings.php
require_once "$IP/extensions/Bootstrap/Bootstrap.php"; require_once "$IP/skins/Chameleon/Chameleon.php";
i installed Bootstrap for skin Chameleon skin
while opening a page getting Error
Fatal error: Cannot use object of type Closure as array in D:\xampp\htdocs\SNWiki\extensions\Bootstrap\src\Hooks\SetupAfterCache.php on line 119
Here the Line 119 in SetupAfterCache.php
protected function removeLegacyLessCompilerFromComposerAutoloader() {
$autoloadFunctions = spl_autoload_functions();
foreach ( $autoloadFunctions as $autoloadFunction ) {
$classLoader = $autoloadFunction[ 0 ];
if ( is_a( $classLoader, '\Composer\Autoload\ClassLoader' ) ) {
$classMap = $classLoader->getClassMap();
if ( !is_array( $classMap ) ||
!array_key_exists( 'lessc', $classMap ) ||
strpos( $classMap[ 'lessc' ], '/less.php/less.php/lessc.inc.php') !== false ) {
$classLoader->addClassMap( array( 'lessc' => null ) );
}
break;
}
}
}
Please do the need ful
Thanky ou
-- Ragu Thangavel Ragusathis (talk) 12:45, 5 March 2015 (UTC)
- Thanks for the bug report!
- I just fixed it. F.trott (talk) 15:52, 5 March 2015 (UTC)
- Thank you Ragusathis (talk) 03:08, 6 March 2015 (UTC)
Why wont bootstrap show up when i go to the the special:version page?
I installed bootstrap using composer and added the files to the extensions folder in a folder called Bootsrap and did this require_once "$IP/extensions/Bootstrap/Bootstrap.php"; for localsettings. the roblem is it wont show as an installed extension. 209.6.197.188 15:16, 16 April 2015 (UTC)
- You do not have to manually add any files, nor do you have to insert anything into LocalSettings.php. See Extension:Bootstrap#Installation F.trott (talk) 15:20, 16 April 2015 (UTC)
- ok. I removed the folder and the require once. I installed the files created using the command line to the extension folder in mediawiki, but it still wont show up. 209.6.197.188 16:02, 16 April 2015 (UTC)
- I'll see if I can reproduce this. You are on MW 1.25? F.trott (talk) 16:05, 16 April 2015 (UTC)
- 1.24.0 209.6.197.188 16:06, 16 April 2015 (UTC)
- adding a require once for the bootstrap extesion in localsettings.php got it to show in the version page as installed. 209.6.197.188 03:52, 17 April 2015 (UTC)
- 1.24.0 209.6.197.188 16:06, 16 April 2015 (UTC)
- using the command line to the extension folder in mediawiki
- The command has to be run from the MediaWiki installation directory. F.trott (talk) 12:49, 19 April 2015 (UTC)
- I'll see if I can reproduce this. You are on MW 1.25? F.trott (talk) 16:05, 16 April 2015 (UTC)
- ok. I removed the folder and the require once. I installed the files created using the command line to the extension folder in mediawiki, but it still wont show up. 209.6.197.188 16:02, 16 April 2015 (UTC)
How can i use Bootstrap just with a SpecialPage?
Hi,
i installed Bootstrap like it is stated in the tutorial and it seems to be running if i take a look at the Special:Version page.
I only want to use Bootstrap in one single special page, therefore i tried the $wgout method but the bootstrap css is not applied to the elements of the special page.
What am i doing wrong? 139.30.103.216 (talk) 20:35, 13 July 2015 (UTC)
Configuration options
Hello F.trott,
would it be possible to make the 'localBasePath' and 'remoteBasePath' options that are passed to SetupAfterCache configurable? Background of this request is, that - even though installing the extension using the main composer.json file of MediaWiki has a lot of advantages - it is a little bit difficult to deploy the extension to places where composer is not available. This is for example the case with a lot of existing intranet wikis.
If I could run "composer install" from the extension directory and then just copy it to the destination it would be much easier. Osnard (talk) 07:26, 8 August 2016 (UTC)
Bootstrap CSS directives won't apply
At first, I want to thank you for your extension! It really spares me a lot of time not having to figure out how to get Bootstrap running with MediaWiki. Unfortunately, it's not working out-of-the-box for me. I've followed the installation instructions and your extension shows up on the Special:Version page, but the Bootstrap CSS directives fail to spawn.
I'm writing an extension that uses its own content model. In fillParserOutput, where I add all my resource loader modules, I retrieve the singleton and add all Bootstrap modules via addAllBootstrapModules. However, the Bootstrap CSS directives do still not seem to apply. Is there anything I am missing or do I need to add the Bootstrap modules at another point in time?
It may be worth noting that I can not see any Bootstrap CSS/LESS files in the directory of your extension - in case they are downloaded to this one, at all. 178.0.131.87 (talk) 10:02, 30 January 2017 (UTC)
- After addAllBootstrapModules you need to add the module 'ext.bootstrap' to the OutputPage. F.trott (talk) 15:01, 4 February 2017 (UTC)
- (I've started this topic) Yeah, I'm doing exactly what the installation and the usage sections of the extension told me to. Today I've noticed that the extension actually is working if I'm in debug mode (appending 'debug=1' to the URL parameters). Is this a caching issue or what kind of sorcery is preventing the extension to work in normal mode? Sebschlicht (talk) 15:27, 3 March 2017 (UTC)
- It could indeed be a caching issue. If the page is retrieved from the cache, it may be that the hook you are using is never called. If that is the case it might be better to work with the ParserOutput object instead of the OutputPage. F.trott (talk) 17:51, 3 March 2017 (UTC)
- Wouldn't this mean that everything should work fine on new pages that could impossibly be cached before? The extension doesn't show on new pages as well...until switching to debug mode! Sebschlicht (talk) 10:33, 4 March 2017 (UTC)
- Not necessarily. A page consists of several calls, each of which is cached separately. So if your new page uses the same styles as other pages these styles may come from the cache. Although I admit that it is sometimes not so easy to find out what is cached and what is not. F.trott (talk) 10:43, 4 March 2017 (UTC)
- I've tried to add the Bootstrap module using the ParserOutput in the OutputPageParserOutput hook. Same results here. Sebschlicht (talk) 10:56, 4 March 2017 (UTC)
- Let's step back. What is the absolute minimum to get the extension running? (1) get BootstrapManager singleton and (2) add which modules are needed, e.g. all via addAllBootstrapModules. Then (3) add the Bootstrap modules, e.g. ext.bootstrap.style, via ParserOutput/OutputPage->addModuleStyles and (4) add the modules of my own extension in the same way.
- Are these all steps necessary and is the ordering correct? Sebschlicht (talk) 11:00, 4 March 2017 (UTC)
- I think that should be it. F.trott (talk) 11:08, 4 March 2017 (UTC)
- Okay, now I'm pretty sure that is not an issue with your extension:
- If I register module styles within the OutputPageParserOutput hook, both your extension's and my own extension's styles are applied in debug mode only.
- I have no idea what's going on here... Do you know which cache could cause this issue and/or how to clear it or all caches involved? Sebschlicht (talk) 11:08, 4 March 2017 (UTC)
- Not sure. There is $wgParserCache, but I don't know if it is used by the Resource loader. It might also be worth seeing if the call to retrieve the styles is contained in the HTML of the page and if it returns valid styles. F.trott (talk) 11:15, 4 March 2017 (UTC)
- The call to retrieve the styles is triggered in both normal and debug mode. However, in normal mode its response doesn't contain the Bootstrap style directives. Sebschlicht (talk) 12:07, 4 March 2017 (UTC)
- Ok, I tried it and it turns out that the instructions are somewhat inaccurate. In fact, they are totally borked. :)
- Here is what you need to add to
LocalSettings.php
to enable Bootstrap styles on all pages: - F.trott (talk) 20:54, 6 March 2017 (UTC)
$wgHooks['SetupAfterCache'][]=function(){ \Bootstrap\BootstrapManager::getInstance()->addAllBootstrapModules(); return true; }; $wgHooks['ParserAfterParse'][]=function( Parser &$parser, &$text, StripState &$stripState ){ $parser->getOutput()->addModuleStyles( 'ext.bootstrap.styles' ); $parser->getOutput()->addModuleScripts( 'ext.bootstrap.scripts' ); return true; };
- Thanks for looking into this issue, I really appreciate it!
- However, this doesn't work for me neither :D
- Again, in debug mode it works. In production mode it doesn't.
- I've looked into this issue in more detail and here's what happens:
- In production mode, all modules are loaded in one or two requests.
- The request asks for your extension's module but its response doesn't contain any Bootstrap directives.
- In debug mode, all modules are loaded in single requests.
- The request retrieving my extension's module returns the most recent version of my files.
- The request retrieving your extension's module returns a stylesheet containing the Bootstrap directives AND an old version of my own extension's stylesheet.
- I remember to use addExternalModule like in the Chameleon skin and I guess the resource loader at some point decided to cache the response - including my module.
- However, this is really frustrating because in the resulting sheet these old directives are below my most recent ones and thus override all of them that don't have a higher cascade weight.
- In production mode the response might have also be cached at a point in time when I didn't get your extension to fully work yet.
- However, I have no idea how to cope with this issue.
- Restarting the vagrant VM doesn't change anything. I've disabled caching wherever I could and cleared the central cache folder without success.
- Database tables like *cache are empty. And so is my browser cache.
- I have no idea where it's being cached. Maybe on HTTP server level. 92.73.1.231 (talk) 09:07, 7 March 2017 (UTC)
- Okay, I have to revise my statement:
- Adding the hooks to the LocalSettings.php actually DOES work for both modes!
- However, this is not what I need because I want to use Bootstrap within my extension, I don't want to force the whole installation to use it :/ Sebschlicht (talk) 10:04, 7 March 2017 (UTC)
- Well then for ParserAfterParse you have to make sure it is only applied in case you need it. The SetupAfterCache hook does not hurt. It just registers the module without actually delivering it to the client. F.trott (talk) 11:00, 7 March 2017 (UTC)
Fatal error: Call to a member function ucfirst() on a non-object
We get this error when we update to 1.29 from 1.27 with this extension enabled: "Fatal error: Call to a member function ucfirst() on a non-object in /srv/www/scoutwiki/htdocs-1.29/includes/user/User.php on line 1079"
Do you know why and how to fix that? Egel (talk) 21:33, 14 July 2017 (UTC)
- The error with ucfirst() is when loged in and the error is Fatal error: Call to a member function getCode() on a non-object in /srv/www/scoutwiki/htdocs-1.29/includes/user/User.php on line 1578 when loged out. Egel (talk) 22:21, 14 July 2017 (UTC)
- Could be connected with the extension using $wgUser at a time when it is not yet initialized. Could be something else completely.
- If you could open an issue at https://github.com/cmln/mw-bootstrap/issues including a stack trace, that would be very much appreciated. F.trott (talk) 00:31, 15 July 2017 (UTC)
- Opened issue. Egel (talk) 06:35, 17 July 2017 (UTC)
- I am getting this error. Anyone know how to fix? 188.29.165.20 (talk) 11:04, 26 July 2017 (UTC)
- More information is needed to fix this.
- See https://github.com/cmln/mw-bootstrap/issues/1 F.trott (talk) 11:13, 26 July 2017 (UTC)
Installation
I installed mw1.26.4 and tried to install chameleon-skin which required the bootstrap-extension. So i downloaded mw-bootstrap-1.2.1.zip into /extensions and unzipped it and renamed it to bootstrap .
After this i edited composer.json in the root and added behind "zordius/lightncandy": "0.21",
the line "mediawiki/bootstrap:~1.0"
but i have no installation... Manbu (talk) 19:33, 26 August 2017 (UTC)
- What is the specific reason for not following the installation instructions of Chameleon? F.trott (talk) 20:12, 26 August 2017 (UTC)
- Only with require_once "$IP/skins/chameleon/Chameleon.php"; appears a line which request to install bootstrap : Error: The Chameleon skin depends on the Bootstrap extension. You need to install the Bootstrap extension first.
- ..... "zordius/lightncandy": "0.21",
- "mediawiki/chameleon-skin": "~1.0",
- "mediawiki/bootstrap:~1.0"
- has no effect.
- The problem is that i only have a provider and filezilla. I cannot execute composer.
- Therefore i added the lines to composer.json but i have no installation.
- If i add wfLoadExtension( 'Bootstrap' ); an error appears instead : Fatal error: Uncaught Exception: .....htdocs\mw1264/extensions/Bootstrap/extension.json does not exist! ...
- (In the specific directory are composer.json and package.json) . To experimental rename composer.json to extension.json leads to Error: The Chameleon skin depends on the Bootstrap extension. You need to install the Bootstrap extension first. Manbu (talk) 10:39, 27 August 2017 (UTC)
- Adding the lines to composer.json does not install anything. You need to execute composer. This will download the Chameleon skin and all its dependencies (including Bootstrap) and install them in the correct location.
- If your provider does not provide you with shell access you can not directly install Chameleon (or any other skin or extension requiring composer). In this case you should create a local MediaWiki installation with all skins and extensions and then upload that in its entirety to the server. F.trott (talk) 11:06, 27 August 2017 (UTC)
- You dont see a possibility to add the wfLoadExtension-choice to the bootstrap-master ?
- 2. The problem will be the database. Many providers will not allow to access it from a pc. So one has to make an normal online installation and delete it with exception of localsettings.php)
- (Another possibility would be to write a composer-modul-extension which can be put to 1 Minute and a very long cycle or even switched off completely) Manbu (talk) 19:48, 27 August 2017 (UTC)
- It's not that easy. You would need to include all dependencies in a downloadable package. To maintain installability with composer you would then have to add a switch to discover and use either the composer-installed dependencies or the ones installed with the downloadable package. Next you would have to add the activation by wfLoadExtension. At that point you would have a Bootstrap extension installable on its own. Next you would have to do all of the above steps with the skin. A better solution might be to not provide a separate package for the Bootstrap extension at all, but to somehow bundle Chameleon and the Bootstrap extension and all dependencies into one package. You'd have to come up with some plan of how to install everything in the correct place. Whatever that place might be. E.g. it might be an idea for the bundle to not install the Bootstrap extension in the /extensions folder, but in some subfolder of the skin.
- Regarding the database I do not see the problem. You should be able to 1.
git pull
MediaWiki locally, 2. add all your (non-composer) extensions and skins, 3. modify composer.local.json and 4. runcomposer update
. Then you upload the whole thing and install as usual. F.trott (talk) 20:29, 27 August 2017 (UTC) - I liked to have an independent version of the skin which integrates bootstrap by #import because i can then exchange it with Yaml and import others.
- Mediwiki should add a composer-tab after admin-login which presents a field with username and password (for ssh)
- and a list of choosable composer - orders (inclusive update) and a run-button. But i dont know who is responsioble for that. Manbu (talk) 18:33, 1 September 2017 (UTC)
Vector styles change significantly
Why Vector skin change significantly when loading this extension?
Example screenshot
Off: https://i.imgur.com/GQYi5hz.png
On: https://i.imgur.com/M9Gr7wW.png
As you may notice everything is a lot more little after applying settings. Also margins and paddings are shorter between images and texts for example.
I'm not using any specific CSS code for format. What it's more strange it's why everything it's way more little
Code used:
$wgHooks['SetupAfterCache'][]=function(){
\Bootstrap\BootstrapManager::getInstance()->addAllBootstrapModules();
return true;
};
$wgHooks['ParserAfterParse'][]=function( Parser &$parser, &$text, StripState &$stripState ){
$parser->getOutput()->addModuleStyles( 'ext.bootstrap.styles' );
$parser->getOutput()->addModuleScripts( 'ext.bootstrap.scripts' );
return true;
}; SirLouen (talk) 18:03, 17 September 2017 (UTC)
- Bootstrap (the package, not the extension) contains some styles that are invoked even if no specific classes are used on the html elements, e.g. for normalization. If you want to find out about the styles on a specific element, use your browsers developer tools. F.trott (talk) 20:09, 17 September 2017 (UTC)
- Thanks for the answer. I was supposing so. But I thought that the extension was prepared to manage Vector skin at least (without modifications).
- So it's essentially common, that Vector skin by default with bootstrap extension changes the appearance that significantly?
- I would like to see if someone can make a "fix" in the future, to maintain Vector appearance, despite of Bootstrap extension introduction. SirLouen (talk) 15:10, 18 September 2017 (UTC)
- I am afraid so. This extension really only pulls the Bootstrap package in. It was originally developed as a basis for other skins and extensions (for the Chameleon skin, in particular), hence the rather complicated instructions to activate it stand-alone. However, if you want to use it with Vector it should be fairly easy to pull in additional Less files to get a similar look. You'd have to make sure of course, that any changes you introduce are still compatible with Bootstrap. E.g. I suspect that Vector might use a different box-sizing and you'd have to weigh the pros and cons of using either border-box or content-box. And you'd probably have to update that Less file whenever Vector is updated.
- Another approach might be to not pull in all Bootstrap modules, but only the ones you need and hoping that Vector does not get too much out of shape. But I have to admit that I never got around to do this myself and so the methods are there, but I am not sure that they work as expected.
- Finally there is also Extension:BootStrap (notice the different spelling), that claims to be "Designed and tested using the Vector Skin only", but I never tried it and I don't know if it is still maintained.
- In any case, whatever solution you come up with in the end, it'd be great if you keep me updated. F.trott (talk) 15:38, 18 September 2017 (UTC)
- Yes, I also checked that extension, but there is a problem. Download links are broken. SirLouen (talk) 15:58, 18 September 2017 (UTC)
Install to GoDaddy Shared Hosting
GoDaddy shared hosting has composer installed (version 1.7.2). My Mediawiki installation was done via cPanel installatron. The mediawiki installation folder is named "wiki". In the folder wiki/vendor resides the composer folder, the composer.json file, and the composer.lock file.
I created the composer.local.json file in the wiki folder as instructed. However whenever I run composer update --no-dev "mediawiki/bootstrap" in the wiki folder, I receive and error stating that "Composer could not find a composer.json file in path/wiki To initialize a project, please create a composer.json file as described in the --link to site-- "Getting Started" section"
I am not familiar with composer so any help would be greatly appreciated. 173.239.198.49 (talk) 03:05, 14 May 2019 (UTC)
Menu groups I now have to click twice before I get the dropdown menu
RESOLVED | |
Caused by the LinkedWiki extension |
The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
MediaWiki 1.31.7
PHP 7.3.18 (apache2handler) MySQL 8.0.20 Chameleon 3.0.0
Why do I have click twice to get the drop down menu?
This was not the same as in Chameleon 1.7.1 Legaulph (talk) 09:50, 12 June 2020 (UTC)
- also Chameleon 3.0.0 installs bootstrap 4.2.1 and 4.2.0 is required Legaulph (talk) 09:54, 12 June 2020 (UTC)
- This was reported with issue 166. Thanks for noting. [[kgh]] (talk) 14:45, 12 June 2020 (UTC)
- I installed bootstrap 4.2.0 with composer Legaulph (talk) 15:11, 12 June 2020 (UTC)
- Why do I have click twice to get the drop down menu?
- This was not the same as in Chameleon 1.7.1 Legaulph (talk) 15:12, 12 June 2020 (UTC)
- The second issue was reported with Chameleon issue 170. [[kgh]] (talk) 20:31, 22 June 2020 (UTC)
Bootstrap Tabs
RESOLVED | |
With the Extension "HTMLTags" it is possible to allow the a-Tag with specific attributes. As that was added as allowed the tabs worked. |
The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
Hi everyone,
does someone know how to create those tabs?
The problem is, that the <a> - Tags are not displayed as Tabs but as HTML-Code, because this tag is not allowed by the MW-Software. On this wiki you can have a look at the issue!
Another Skin called Foreground was able to do that. Maybe someone has an idea.
Thanks, DesignerThan DesignerThan (talk) 20:37, 5 January 2021 (UTC)
- If I change the <a>-Tags to <span>-Tags, the Tabs show correctly but the JS-Tabs don't work. That would be the other thing to solve. I hope someone knows how to solve that. DesignerThan (talk) 22:15, 5 January 2021 (UTC)
- Have a look at the "HTML Tags" extension to get the
<a>
tags on board. However only feasible/advisable on closed wikis with trusted users. - I also use this extension on a wiki with Foreground to get accordions going. Currently the server hosting the demo wiki for Forground is down for maintenance so I cannot link right now. [[kgh]] (talk) 22:15, 5 January 2021 (UTC)
- Thanks for the fast answer. I don't know if that is a solution for us, we have a big community. The thing that throws me off is, that the Tabs from the FG-Skin also with <a>-Tags for the tab's actually work. DesignerThan (talk) 22:25, 5 January 2021 (UTC)
- It appears that the "BootstrapComponens" extension does not provide tabs but all the rest.
- I have browsed a bit. It seems that people are using "Header Tabs" extension to get tabs on Chameleon which is a bit derp.
- Foreground is still using Foundation 5 for that reason. With Foundation 6 this will not longer work. So no upgrade to version 6. [[kgh]] (talk) 23:54, 5 January 2021 (UTC)
- I will have a look at BootstrapComponents as at HTML Tags. Then I will see what happens.
- I had a look at the code of Foundation 5 and in the Skin Template file I found the issue why the tabs are working for them. One point is, that you need to activate the feature in the LocalSettings.php, and if that is done they don't use the content output method of MW, they just use echo to output it. That is, I guess, why the <a> tags work in the Foundation Skin.
- Thanks for your help so far. We are using the Extension Header Tabs but I would like to get rid of it, don't like the style very much. DesignerThan (talk) 12:47, 6 January 2021 (UTC)
- After I installed the "HTML Tags" and added the a-Tag with the following code to the allowed Tags and now the tabs work.
$wgHTMLTagsAttributes['a'] = [ 'href', 'class', 'id', 'data-toggle', 'role', 'aria-controls', 'aria-selected' ];
- Do I create a threat for the wiki, if I allow the a-Tags with those attributes? DesignerThan (talk) 13:41, 6 January 2021 (UTC)
- Well, you could add everything to a link by allowing the a tag. This is why it is not possible on MediaWiki. You need to trust your users or check everything they do here. If in doubt I would not do it. [[kgh]] (talk) 18:36, 6 January 2021 (UTC)
Override Bootstrap Mixins
Hallo,
is it possible to override Bootstrap's Mixins?
Kind regards,
DesignerThan DesignerThan (talk) 01:18, 10 January 2021 (UTC)
Bootstrap scripts takes seconds to load on each page visit
I am using the Extension:Bootstrap for the Chameleon Skin and have noticed from the network waterfall in the browsers dev tools that a) that the bootstrap scripts are always loaded anew with every page, and b) that the time it takes for the bootstrap scripts to load (6-8 seconds) is the longest activity in the entire page load process.. My bootstrap installation is simple, just a composer load and the usual wfLoadExtension( 'Bootstrap' ); in LocalSettings.php.. Is this long load time behavior normal for bootstrap? Is there any way to speed it up? Thanks! Revansx (talk) 13:21, 14 July 2022 (UTC)
Dark Mode Theme
Does anyone know of a Dark Mode theme (SCSS file) that can be used for Skins like Chameleon that use Bootstrap? Revansx (talk) 20:35, 10 August 2023 (UTC)