Jump to content

Manual:Edició de seccions

From mediawiki.org
This page is a translated version of the page Manual:Section editing and the translation is 48% complete.

L'edició de seccions és la pràctica d'editar una secció concreta d'una pàgina fent clic a l'enllaç "modifica" (o "modifica el codi") que hi ha al costat d'un subtítol.

This page is for the technical details of section editing and how to configure it. See Ajuda:Secció for the end-user documentation about the feature.

Existing sections

When editing a section in the source editor, the URL contains section=n where n is an integer index to the section being edited. These are counted from 0 (but see #Lead section below for more about section 0). If you try to edit a section number that doesn't exist, you'll get an error message.

When editing a section, the edit summary field is pre-populated with a special section indicator, such as /* Existing sections */, which will be turned into a link when it's viewed in page history, diffs, etc.

When opening a section for editing in the VisualEditor , the whole page is opened for editing. The main difference between this and editing the whole page is that the edit summary is still pre-populated with the section name.

New sections

It is possible to create a new section at the end of a page by adding section=new to the URL. This opens the normal editing form, with an additional text field above the page textbox (labelled 'Subject:'), into which the section title can be entered.

In addition, the normal edit summary field is hidden. It's not possible to add an edit summary when adding a new section, because the section title will be used (in fact, the 'Subject:' and 'Summary (?):' fields are internally the same). The phrase 'New section' will be added to the generated edited summary.

If the DiscussionTools extension is installed, adding a new section will not open the page editing form but instead direct you to a new comment form at the bottom of the page.

Lead section

Page content that is before the beginning of the first section is called the "lead section" or "section zero". It can not be edited directly via the UI in most skins, but it is possible to manually change the edit URL to include section=0. Various Gadgets exist to make this easier, such as the edittop gadget.

Right-click to edit

La preferència d'usuari Habilita l'edició per seccions en clicar amb el botó dret sobre els títols de les seccions (cal JavaScript) (editsectiononrightclick, "0" per defecte) permet als usuaris editar una secció fent clic amb el botó dret a l'encapçalament de la secció. This feature requires JavaScript to be enabled.

Limitacions

  • La funció Vistes prèvies de pàgina de Extension:Popups només pot mostrar una part de la secció inicial, cosa que podria interferir amb les unitats de traducció si s'utilitza Extensió:Translate .
  • La redacció o el format poden ser més difícils de triar sense veure el contingut d'abans o de després de la secció editable.

Habilitar i deshabilitar els enllaços de secció

L'edició de seccions és una funció predeterminada de MediaWiki, però es pot deshabilitar de diverses maneres, tal com s'explica a continuació. La deshabilitació és especialment útil quan es crea un encapçalament des d'una plantilla : l'edició de secció wiki normal en aquest cas editaria el codi de la plantilla, cosa que normalment és contraintuïtiva per a l'usuari.

Historical note: In MediaWiki 1.23 and earlier there was a user preference for disabling the section editing links. This was removed with T54811.

Site or user stylesheets

It is possible to use the global or personal stylesheets to remove the section editing links. The following CSS shoulg be added to MediaWiki:Common.css or Special:MyPage/common.css:

.mw-editsection {
    display:none !important;
}

Paraula màgica

La paraula màgica __NOEDITSECTION__ es pot utilitzar per ocultar tots els enllaços d'edició de seccions en una pàgina concreta.

Aquesta paraula màgica és transcloïble, és a dir, es pot incrustar en una plantilla per desactivar l'edició de seccions a totes les pàgines on s'utilitza aquesta plantilla.

Col·locació i estilització d'enllaços de secció

CSS

In Vector and other skins, the section link has the following CSS class:

.mw-editsection