Manual:Skin configuration/it

From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page Manual:Skin configuration and the translation is 37% complete.

Other languages:
Deutsch • ‎English • ‎Nederlands • ‎español • ‎français • ‎italiano • ‎polski • ‎português do Brasil • ‎български • ‎русский • ‎中文 • ‎日本語 • ‎한국어

Questa pagina contiene informazioni complete per gli amministratori su come configurare le skins in una wiki. Fare riferimento a Help:Skins per informazioni generali sulle skins e Manual:Skinning per informazioni di sviluppo per la creazione di nuove skins.

Questa documentazione si applica alla versione MediaWiki 1.24 e successive.

Scaricare le skins

Il tarball di MediaWiki viene fornito con quattro skins: Vector (lo skin di default), MonoBook, Modern e Cologne Blue.

Tuttavia, se hai scaricato MediaWiki da Git o da una versione nightly, o se vuoi installare skins aggiuntive, dovrai scaricare separatamente il codice per quella skin o per quelle skins.

Alcune skin MediaWiki sono contenute nel repository Git di Wikimedia (vedi la lista completa qui). Si possono scaricare le tarballs delle skins dallo skin distributor.

Per scaricare una delle skins di questo gruppo via Git, occorre dare un comando come il seguente:

git clone https://gerrit.wikimedia.org/r/mediawiki/skins/[name of skin]

ad es.: per ottenere la skin di default Vector, occorre dare il seguente comando dalla cartella MediaWiki-core/skins/:

git clone https://gerrit.wikimedia.org/r/mediawiki/skins/Vector

Controllare una appropriata release della skin. Change into the new directory and run:

git checkout REL1_27 (or other release version or tag)

Unfortunately, there is currently no way to download an additional skin other than via Git, but the mechanism to do such a thing is being developed.

After you have obtained the folder of a skin's files, place it as a subdirectory of /skins in your MediaWiki installation (you can place the Git repository there directly).

Attivare le skins

Per ogni skin nella propria cartella /skins che si intende utilizzare, occorre abilitarla nel file LocalSettings.phpManual:LocalSettings.php. Ad esempio, per abilitare Vector, aggiungere quanto segue. Se si hanno skins multiple, ciascuna deve essere attivata con una distinta dichiarazione:

// mw.v 1.24.x or less
require_once "$IP/skins/Vector/Vector.php";
// mw.v 1.25.x or above
wfLoadSkin( 'Vector' );

(This is equivalent to enabling an extension, only in a different directory.)

Additional steps may be required depending on the choice of skin. Detailed installation instructions are available on each skin's page on mediawiki.org; for example, for Vector see Skin:Vector#Installation. Instructions for all other skins are analogous.

Settare la skin di default per la wiki

A default skin should be set for new users of a wiki by setting the variable $wgDefaultSkinManual:$wgDefaultSkin in LocalSettings.phpManual:LocalSettings.php to the lowercase skin name specified in the skin file. Users can still change their skin by going to their preferences page, unless you uninstall or suppress all other skins, or disable the preference altogether (see below). For example:

$wgDefaultSkin = 'vector';

Changing these value on an existing wiki will automatically change the setting of all users who have been using the previous default skin. There is a maintenance script to change users' preferences (userOptions.php), but you will most likely not need to use it.

If you do not change this value, Vector will be the default skin.


Disinstallare la skin

To uninstall a skin, remove the require_once line from your LocalSettings.php file. You may remove the skin files from the skins/ directory afterwards.

If any users have been using the skin you just uninstalled, MediaWiki will automatically switch them to the default skin of the wiki.

Disabilitare le skins senza disinstallarle

The administrator can limit the skin choices that are offered site-wide in user's preferences by listing skin(s) to suppress in the $wgSkipSkinsManual:$wgSkipSkins array. This might be useful if you want to test a new skin without letting users see it. To do this, put something like this in LocalSettings.phpManual:LocalSettings.php:

// To remove various skins from the User Preferences choices
$wgSkipSkins = array( "cologneblue", "monobook" );

You will be able to preview the skin using the useskin URL parameter.

Site-wide CSS modifications

MediaWiki allows administrators to specify site-wide CSS rules to be added to every page rendered. These rules can be added by editing the page Common.css on your wiki, if $wgUseSiteCssManual:$wgUseSiteCss is set to true. In addition to a global stylesheet, one can also specify CSS rules to be used only in certain skins (see Manual:Interface/Stylesheets).

User CSS modifications

Users can also specify their own CSS rules by creating the page "User:Username/common.css". The CSS on this page is then applied to whatever skin the user is using. If the website is changed to a different default skin, the user's custom CSS will continue to work just as before. This feature can be enabled by setting $wgAllowUserCssManual:$wgAllowUserCss to true in LocalSettings.php. A user can also apply CSS to a specific skin by creating the page "User:Username/skinname.css". If a user uses the MonoBook skin for example, they would edit the page Special:MyPage/monobook.css.

Disable site users' ability to choose skins in user preferences

MediaWiki versione: 1.16

The system administrator can completely remove the "Skin" option so that it does not show up at all in User Preferences. This makes sense if your site will use a customized skin and would not look right in any other skin.

To do it, add a new line containing the following code to LocalSettings.php. It will remove the "Skin" option from preferences and the possibility to use the useskin parameter in the URL.

$wgHiddenPrefs[] = 'skin';