Jump to content

Manuel:Modifier une section

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

Modifier une section consiste à mettre à jour une section particulière d'une page en cliquant sur le lien « modifier » (ou « modifier le wikicode ») qui se trouve à côté de son titre.

This page is for the technical details of section editing and how to configure it. See Aide:Section 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

editsectiononrightclick (0 par défaut) est un droit utilisateur qui permet aux contributeurs de modifier les sections en cliquant-droit sur le sous-titre (fonctionnalité JavaScript). This feature requires JavaScript to be enabled.

Limites

  • Page Previews n'affichera uniquement que la partie de l'article pouvant être problématique pour le texte...
  • La formulation ou la mise en forme peuvent être plus difficiles à choisir s'il n'y a pas de contenu avant ou après la section modifiable.

Activer ou désactiver les liens de section

L'édition de section est une fonctionnalité par défaut de MediaWiki, mais elle peut être désactivée de plusieurs façons, comme expliqué ci-dessous. La désactivation est particulièrement utile lorsqu'un article est créé à partir d'un modèle : la section d'édition normale du wiki modifiera dans ce cas le code du modèle, ce qui est normalement contre-intuitif pour l'utilisateur.

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;
}

Mot magique

Le mot magique __NOEDITSECTION__ peut être utilisé pour masquer tous les liens de modification de section sur une page donnée.

Ce mot magique est transcluable, ce qui signifie qu'il peut être intégré dans un modèle afin de désactiver l'édition des sections sur toutes les pages où ce modèle est utilisé.

Insérer et mettre en forme les liens de section

CSS

Dans Vector et autres habillages, le lien de section a la classe CSS suivante :

.mw-editsection