- 1 Can anonymous users choose a mediawiki skin?
- 2 What's available?
- 3 Thoughts on Skin Selection
- 4 Results: A mediawiki skin that detects browser and is switchable
- 5 To do
1 Can anonymous users choose a mediawiki skin?
Is it possible to do the same for mediawiki skins?
The idea behind this question is to offer a low bandwidth skin (for use in developing countries, as well as over mobile), that should be user selectable (without logging in). This has two parts:
- The skin selection itself (manual, based on browser, or css media=handheld), but also having
- a suitable low bandwidth skin (see Mediawiki access/Monobmo).
There doesn't seem to be an extension or skin available, so let's experiment a little.
2 What's available?
2.1 Ad-hoc skin selection
2.2 Extensions to select skins per page, namespace, or browser
There are some extensions that allow page or namespace specific selection of skins:
- http://www.mediawiki.org/wiki/Extension:SkinPerPage (for examples see Mediawiki/SkinPerPage)
- and also on the type of browser: http://www.mediawiki.org/wiki/Extension:MobileSkin (example on Mediawiki access/Mobile/Skin).
(Note that there is some interaction between these extensions if they are all installed. You need to double check that you get the desired results. For instance, the MobileSkin overrides SkinPerPage. If the MobileSkin.php is included, SkinPerNamespace no longer works on desktop browsers, but it does still work for mobile browsers. It would be a useful project to make those compatible with each other in a sensible way.)
The following two projects refer to skin selection, but there doesn't seem to be code downloadable:
- http://www.aboutus.org/UrlMagic which is similar to SkinPerPage, but it also redirects the full url, turning a single mediawiki installation into a multi-site CMS. Nice, but no code available ti seems.
2.4 Mediawiki 1.14.0: $wgHandheldStyle
Also note the $wgHandheldStyle variable http://www.mediawiki.org/wiki/Manual:$wgHandheldStyle, introduce in 188.8.131.52. This can be set to a string (the skin) or to false. It provides a style for media="handheld".
Example: The current page with handheld=yes.
This is quite useful, as it allows the user to momentarily change the skin, by adding 'handheld=yes'. However, the setting isn't remembered, so only the current page is show in handheld style.
Also, we need to use this with a lightweight skin.
3 Thoughts on Skin Selection
It should be possible to tweak the skin through parameters, perhaps even without modification of mediawiki core.
3.1 Remembering the setting
To remember the setting, we can use a $_SESSION variable.
We can combine the nocss skin (Mediawiki access/Monobmo/nocss), with the original monobook skin, by adding a little bit of code to make the removal of javacsript/css optional, and also store the result in a cookie.
4 Results: A mediawiki skin that detects browser and is switchable
Example here monomix:
Currently, the main skin of the wiki is monomix, and if you have skin=nocss selected, you can browse the whole wiki like that!
- Note, however, that if you are logged in, your skin choice overrides this mechanism. But if you are logged, you can of course go to your preferences and selection the monomix skin, and then the above links will work.
- Note also that the mobile skin extension (Mediawiki/Mobile/Skin) overrides this. (However, we have now built mobile detection into the skin, see Mediawiki access/Mobile/Skin.)
5 To do
- Incorporate the monobmo skin in the above mechanism.
- Need to determine how the various mechanisms interact.
- The mobile skin should be optional, i.e. the mobile user should be able to see the standard skin. (DONE)
- SkinPerPage, SkinPerNamespace should be overridable by the nocss skin, if so desired.
- Logged in users should have a choice over the skin: Either to use the default skin for that page, or to override all settings by their custom skin.