Manual:Configuração de aparências

From mediawiki.org
This page is a translated version of the page Manual:Skin configuration and the translation is 49% complete.
Outdated translations are marked like this.

Esta página explica como configurar skins para administradores da wiki.

Esta documentação aplica-se a MediaWiki 1.24 ou superior .

Para criar novas skins, consulte Help:Skins para informações gerais sobre skins e Manual:Skinning para informações do desenvolvedor.

Para desenvolvedores que desejam criar novas skins ou editar skins existentes, consulte Manual:Como criar skin MediaWiki para informações técnicas.

Download de skins

O Tarbal do MediaWiki vem pré-empacotado com várias skins. Veja a lista em Skins e extensões empacotadas#Skins .

Contudo, se você baixou MediaWiki do Git, ou se você quer instalar skins adicionais, você vai precisar baixar o código para essa(s) skin(s) separadamente.

Muitas skins MediaWiki estão hospedadas no repositório Git da MediaWiki (veja a listagem completa do repositório de skins) Você pode baixar os tarballs das skins a partir de um distribuidor de skin.

Para baixar uma das skins deste grupo via Git, você deve fazer um um request semelhante ao seguinte:

git clone https://gerrit.wikimedia.org/r/mediawiki/skins/[nome da skin]

ex: Para baixar o skin padrão Vector, você deve executar o seguinte a partir do sub diretório skins/ da sua pasta de instalação MediaWiki:

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

Fazer o checkout de uma release especifica da skin Mudar para o novo diretório e executer:

git checkout REL1_35

(substitua REL1_35 por outra release branch ou tag)

Habilitando skins Para qualquer skin em seu diretório /skins que você deseje usar, você deve ativá-la no seu arquivo LocalSettings.php Por exemplo, para permitir Vector, adicione o seguinte. Caso você tenha múltiplas skins, cada uma deve estar ativa com uma declaração separada:

// MediaWiki 1.24 or less
require_once "$IP/skins/Vector/Vector.php";
// MediaWiki 1.25+
wfLoadSkin( 'Vector' );

(Isto é equivalente a ativando uma extensão, somente em um diretório diferente.)

etapas adicionais podem ser necessárias, dependendo da escolha da skin. Instruções mais detalhas de instalação estão disponíveis em cada página da skin no mediawiki.org; por exemplo, para Vector veja Skin:Vector#Installation. O mesmo vale para as outras skins.

Definir a skin padrão para uma Wiki

A default skin should be set for new users of a wiki by setting the variable $wgDefaultSkin in 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 values 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.

Desinstalando skins To uninstall a skin, remove the wfLoadSkin (or require_once for MediaWiki 1.24 or older) 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.

Suppressing skins without uninstalling

The administrator can limit the skin choices that are offered site-wide in user's preferences by listing skin(s) to suppress in the $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.php :

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

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 Gadget-site.css (old Common.css) on your wiki, if $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 $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

Versão MediaWiki:
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';