Topic on Extension talk:Bootstrap

Examples files for beginning

18
Nicolas NALLET (talkcontribs)

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,

F.trott (talkcontribs)

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,

Nicolas NALLET (talkcontribs)
F.trott (talkcontribs)

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.

Nicolas NALLET (talkcontribs)

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";
F.trott (talkcontribs)

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.

Nicolas NALLET (talkcontribs)

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
F.trott (talkcontribs)

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.

Nicolas NALLET (talkcontribs)

ok done but still doesn't work... :(

F.trott (talkcontribs)

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)

Nicolas NALLET (talkcontribs)
F.trott (talkcontribs)

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.

Nicolas NALLET (talkcontribs)

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

108rub (talkcontribs)

I have the same error. All set, but the pattern is not displayed. Please write the full instructions on how you set the template?

F.trott (talkcontribs)
  1. Install the extension
  2. 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.
  3. Call $out->addModuleStyles( 'ext.bootstrap' ) to load the css
    • If you build a skin, this can be done in your subclass of SkinTemplate in the setupSkinUserCss() method
  4. Call $out->addModules( array( 'ext.bootstrap' ) ) to load the javascript
    • If you build a skin, this can be done in your subclass of SkinTemplate in the initPage() method
108rub (talkcontribs)

I am not a programmer, there are step by step instructions? I do not know where to enter the codes.

F.trott (talkcontribs)

If you are not a programmer, this extension is probably not for you. It is not an extension that can be used alone, it only enables the Bootstrap framework so it can be used in other extensions or skins.

What exactly do you want to achieve?

178.168.59.167 (talkcontribs)

\Bootstrap\BootstrapManager::getInstance()->addAllBootstrapModules();

Reply to "Examples files for beginning"