Extension talk:Bootstrap/Flow

About this board

Revansx (talkcontribs)

Does anyone know of a Dark Mode theme (SCSS file) that can be used for Skins like Chameleon that use Bootstrap?

Reply to "Dark Mode Theme"

Bootstrap scripts takes seconds to load on each page visit

1
Revansx (talkcontribs)

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!

Reply to "Bootstrap scripts takes seconds to load on each page visit"

Override Bootstrap Mixins

1
DesignerThan (talkcontribs)

Hallo,

is it possible to override Bootstrap's Mixins?

Kind regards,

DesignerThan

Reply to "Override Bootstrap Mixins"
Summary by DesignerThan

With the Extension "HTMLTags" it is possible to allow the a-Tag with specific attributes. As that was added as allowed the tabs worked.

DesignerThan (talkcontribs)

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 (talkcontribs)

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.

Kghbln (talkcontribs)

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.

DesignerThan (talkcontribs)

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.

Kghbln (talkcontribs)

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.

DesignerThan (talkcontribs)

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 (talkcontribs)

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?

Kghbln (talkcontribs)

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.

Menu groups I now have to click twice before I get the dropdown menu

6
Summary by Kghbln

Caused by the LinkedWiki extension

Legaulph (talkcontribs)
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 (talkcontribs)

also Chameleon 3.0.0 installs bootstrap 4.2.1 and 4.2.0 is required

Kghbln (talkcontribs)

This was reported with issue 166. Thanks for noting.

Legaulph (talkcontribs)

I installed bootstrap 4.2.0 with composer

Legaulph (talkcontribs)

Why do I have click twice to get the drop down menu?

This was not the same as in Chameleon 1.7.1

Kghbln (talkcontribs)

Error installing using Composer

6
Nischayn22 (talkcontribs)

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

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.

F.trott (talkcontribs)

Not any more. Instead MW now has a composer.json, that you have to modify. And remember on every pull to stash and unstash. :(

Kghbln (talkcontribs)

Oh my gosh! Indeed, this is really going to be fun. :(

Nischayn22 (talkcontribs)

That fixed it I guess. Thanks a lot!

Install to GoDaddy Shared Hosting

1
173.239.198.49 (talkcontribs)

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.

Reply to "Install to GoDaddy Shared Hosting"

Vector styles change significantly

5
SirLouen (talkcontribs)

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;

};

F.trott (talkcontribs)

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.

SirLouen (talkcontribs)

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.

F.trott (talkcontribs)

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.

SirLouen (talkcontribs)

Yes, I also checked that extension, but there is a problem. Download links are broken.

Reply to "Vector styles change significantly"
Manbu (talkcontribs)

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

F.trott (talkcontribs)

What is the specific reason for not following the installation instructions of Chameleon?

Manbu (talkcontribs)

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.

F.trott (talkcontribs)

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.

Manbu (talkcontribs)
  1. 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)

F.trott (talkcontribs)

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. run composer update. Then you upload the whole thing and install as usual.

Manbu (talkcontribs)

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.

Reply to "Installation"

Fatal error: Call to a member function ucfirst() on a non-object

6
Egel (talkcontribs)

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 (talkcontribs)

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.

F.trott (talkcontribs)

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.

Egel (talkcontribs)

Opened issue.

188.29.165.20 (talkcontribs)

I am getting this error. Anyone know how to fix?

F.trott (talkcontribs)
Reply to "Fatal error: Call to a member function ucfirst() on a non-object"
Return to "Bootstrap/Flow" page.