Manual:Interface/Sidebar/es

MediaWiki:Sidebar define la barra de navegación, la cual provee enlaces a la mayoría de los lugares en la wiki y suministra a los administradores del sitio un lugar para adicionar una colección constante de enlaces. Por ejemplo, la mayoría de las wikis enlazarán a la página de discusión de su comunidad y a algunas herramientas útiles.

Los skins Monobook y Vector colocan la barra de navegación arriba a la izquierda (top-right for right-to-left languages) junto a la barra de búsqueda y a la caja de herramientas, pero la ubicación puede ser diferente en otros skins. La barra lateral se  oculta a los usuarios del sitio Mobile.

Personalizar la barra lateral
Para personalizar la MediaWiki:Sidebar en una wiki, usted primero necesita estar registrado con un usuario que tenga el permiso editinterface - Esto está habilitado por defecto para los administradores. (Para información sobre asignar un permiso a grupos o usuarios, ver Manual:User rights.)

Luego, use un enlace a una página en su wiki, pero reemplace el título de su página wiki (e.g. ) en la URL/barra de direcciones con   y cargue esa página - Usted debería ver ahora el contenido de la barra lateral. (Usted puede usar la sintaxis //yourdomain/yourwiki/index.php?title=MediaWiki:Sidebar&action=edit si usted utiliza URLs largas.)

Si el contenido de la barra lateral ya ha sido modificado, usted simplemente puede dar clic sobre el enlace Edit o Edit source, de otra forma usted podría necesitar crear primero la página dando clic en Create o Create source.

Nota: Si usted tiene que crear una nueva página, se le presentará el contenido por defecto de la barra lateral en el editor. Para crear exitosamente una página MediaWiki:Sidebar, necesita cambiar el contenido antes de salvar.

A continuación se muestra un código de ejemplo para una barra lateral:
 * navigation
 * mainpage|mainpage
 * Special:RecentChanges|Recent changes
 * new heading
 * portal-url|portal
 * http://www.mediawiki.org|MediaWiki home

Este ejemplo mostrará la siguiente barra lateral:

Encabezados
La barra de navegación puede estar dividida en secciones, cada una con su propio encabezado. El encabezado para cada sección es tomado desde la lista de elementos del primer nivel ("navigation" y "new heading" en el ejemplo de arriba).

Si este texto corresponde al nombre de un mensaje de la interfaz (Una página existente en ese título en la MediaWiki namespace), entonces el texto de esa página es usado como una etiqueta; de lo contrario, el título del encabezado se utiliza tal cual.

Enlaces
Los elementos del segundo nivel de la lista son enlaces ("mainpage|mainpage" en el ejemplo de arriba), donde el formato es: ** target|link text
 * objetivo
 * El enlace objetivo puede ser el nombre de un mensaje de interfaz (una página en el MediaWiki namespace) o una página wiki, o un enlace externo. En cualquier caso, el link puede ser interno, interwiki o externo. En algunos casos (tales como enlaces con el carácter "&"), un mensaje de interfaz es necesario. El enlace objetivo no puede ser dependiente del lenguaje de la interfaz configurada en las preferencias.


 * Algoritmo seguido:
 * Llamar el texto objetivo.
 * Si hay uno existente o un mensaje de interfaz por defecto con ese nombre, use el contenido de ese mensaje en vez del texto objetivo.
 * Si la salida del paso anterior es una URL valida (comenzando con http:// u otro URL protocol), el enlace apuntará a esa URL.
 * si no, se tratará como el enlace objetivo de un wikilink (enlazando a ese nombre de página o interwiki).
 * En caso de que termine enlazando a '-', toda la entrada es removida de la barra lateral (eso es útil para remover una entrada en todos los lenguajes al cambiar el mensaje que tiene el enlace).


 * Ejemplos:
 * " " usa el texto de MediaWiki:Portal-url (el cual contiene "").
 * " " links to Special:RecentChanges, since there is no interface message of that name.
 * " " links to w:Foo for the same reason.
 * " " links to http://www.mediawiki.org for the same reason.


 * link text
 * The link text can be the name of an interface message (page in the MediaWiki namespace) or plain text.
 * If the link text is the name of an existing or default interface message, the content of that message will be used. MediaWiki will check for localized versions; for example, if the current language is fr (French) and the link text is the interface message "forum", it will check for "forum/fr" before using "forum".
 * Otherwise, the link text is used as the target as-is.
 * Notice that the link text is not optional as in normal wiki links. If the link text is missing, the item is ignored.


 * Examples:
 * uses MediaWiki:Mainpage (which contains "").
 * uses "Recent changes", since there is no interface message of that name.

Order of elements
By default, the sidebar consists of elements in this order: navigation, search, toolbox, languages. The order can be changed (in MediaWiki 1.13+) by adding special keywords (SEARCH, TOOLBOX and LANGUAGES) to MediaWiki:Sidebar using the heading syntax. For example, the following code moves the search box to the top of the sidebar:
 * SEARCH
 * navigation
 * mainpage|mainpage
 * Special:Recentchanges|Recent changed
 * new heading
 * portal-url|portal
 * http://www.mediawiki.org|MediaWiki home

Translations
You can translate the strings, which you use, by editing the according pages in the MediaWiki namespace.

Example: The string, which will replace the item named "mainpage", is taken from MediaWiki:Mainpage. To set/change this text for users, who display your wiki in German, you can put the according text on the page MediaWiki:Mainpage/de.

That way you can easily translate these texts through the MediaWiki interface.

Please note that MediaWiki will by default use the content of the Sidebar page in that language, which corresponds to the default language of your wiki. So, if your wiki e.g. uses French as its default language, edit MediaWiki:Mainpage/fr in order to show a modified sidebar to all users, who have not changed their language setting and to all anonymous users.

For more advanced translation, see Help:Extension:Translate/Unstructured element translation.

Advanced customization
The sidebar can be fully customized by implementing JavaScript or Cascading Style Sheets, or by editing the PHP files directly. Before using these methods, note that:
 * JavaScript is fragile: it will not work for users with JavaScript disabled, and scripts frequently fail in different browsers or skins.
 * Editing the PHP files can easily cause unexpected errors, and your changes will be lost in the next update unless you manually change the new files.

Force UI-messages to follow content
Some pages should sometimes follow the content language, especially for multilingual sites. This can be controlled with the setting $wgForceUIMsgAsContentMsg. Each message overridden in this way must be explicitly given, for example to let the sidebar link to versions given by the content language for the main page and the portal page add the following to
 * code

Add or remove toolbox sections (JavaScript)
The toolbox, which appears under the search bar, is a dynamic element and cannot be easily customized without the use of skinning extensions (otherwise it requires programming in PHP.) If you still want to do so, you can copy, creating a new skin. You can then make a custom skin to generate these links in your preferred fashion.

Another JavaScript solution is below.

For this solution to work on the entire MediaWiki site, this script has to be copied to MediaWiki:Common.js (MediaWiki:Common.js is available for MediaWiki 1.9 +).

For this solution to work only for a specific user, add this script to Special:MyPage/common.js (or the JS page for the user's current skin, such as Special:MyPage/monobook.js).

Now simply configure which link should appear in which section. You also can remove some links if you want to.


 * code


 * Usage
 * has to be customized for adding or removing links in specific sections:



If you want to restrict the modification of the links to a specific user group (e.g. bureaucrat), change to
 * restricting modifications to specific usergroups

For restricting the modifications to IPs instead of a specific user group, use

Add or remove toolbox sections (PHP)
You can add in your file LocalSettings.php the hook described on this page. With this, you can modify via MediaWiki:Sidebar the links in the toolbox panel (remove some links, change their name) and add custom links (e.g. add the "Recent changes" link there instead of the navigation panel.

Make expanding/collapsing sidebar for all users (Monobook skin only)
If you use the Monobook skin and don't want to miss the expandable menu bar from e.g. Vector skin, paste the following code into MediaWiki:Monobook.js of your wiki.

Sidebar width in Monobook skin (CSS)
You can change the width of your sidebar by adding the following CSS rules to your MediaWiki:Monobook.css, note that this is an article, not a file. This changes the width to 15em, the actions position and portlet width should be an em or so less, so I've set them to 14em in this example.

Sidebar width in Vector skin (CSS)
You can change the width of your sidebar by adding the following CSS rules to your MediaWiki:Vector.css. The standard width in vector skin is 10em. The following example changes the width to 12em:

Change sidebar content when logged in (PHP)
You can modify the sidebar using a hook. Create a small extension of your own, use Extension:HideSidebar or put the code directly into your LocalSettings.php file.

Some example code adding a 'navigation' sidebar block with a login link for logged out users.

Parser functions in sidebar
Although it is not exactly recommended, the sidebar does support parser functions (such as ParserFunctions), provided the  is outside the parser function, and the parser function does not span multiple lines. For example:
 * Heading

works. However the following would not work since the parser function spans multiple lines:
 * Heading

Changes not showing up
MediaWiki aggressively caches content if possible, which often causes the navigation bar to persist after changes. Purging the cache of affected pages should correct the situation. To perform a mass-purge of all caches at once, touch the  file or truncate the   table in your database (you may have to do both).

You also need to have $wgUseDatabaseMessages set to.

If you are a user or average wiki admin, you will not be able to do the advanced stuff above to get changes to show up. If purging does not work either, you can sometimes still see CSS changes right away in preview (especially when changing your personal CSS). For example; changing the sidebar width, padding, or margins. Changes can take awhile to show up after saving though. If nothing shows up after awhile you may need to contact the overall wiki, or wiki farm, sysop.

Lowercase link labels
If your links are not being capitalized as intended, try adding spaces around the bar character; for example: ** http://www.example.com/download.php?file=44555 | Download

Sections disappear or show unexpected content
If a section does not display or displays unexpected content, check that the header text isn't the name of an interface message by searching Special:AllMessages. If it is, use a different header text, or create a new interface message and use it.

For example, if you want to use "Sidebar" as header text, create the interface message "MediaWiki:Sidebar-header" containing only "Sidebar". Then, use  as header.

Sections are not displayed if there are no links of the form  (e.g. when the target was forgotten).

Broken links after updating Special:Version
This will happen e.g., each time there are newer translations for your site language's sidebar items. One could add new redirect pages each time, but a better solution would be to use one's own sidebar item names instead of trying to keep track of the current MediaWiki translations.

Ancient versions of MediaWiki
If you have a pre-release version of 1.5 Beta, or earlier, it is still possible in some cases to edit the sidebar:
 * Prior to 1.5 branching (between rev:9150 and rev:9177) the message utilized was briefly MediaWiki:Navbar.
 * Before this, version 1.4 had (from rev:5528 to rev:9150) a global variable, titled $wgNavigationLinks.