手册:编辑章节

This page is a translated version of the page Manual:Section editing and the translation is 90% complete.

章节编辑是通过单击副标题旁边的“编辑”(或“编辑源代码”)链接来编辑页面上特定部分的做法。

The Page Previews will only show the part of the article that might be problematic for the text... Wording or formatting can be more difficult to choose without content before or after the editable section.

启用和禁用章节链接

章节编辑是 MediaWiki 的默认功能,但可以通过以下多种方式禁用。 隐藏章节标题旁的编辑链接。当从模板中创建标题时,正常的页面章节编辑将编辑模板代码,这与用户的直觉不符。

配置

editsection 是一项可以在 LocalSettings.php 文件中使用的用户权限。

例如,要为未登录的用户隐藏章节编辑链接,请更改 $wgLocalSettings.php 配置选项:

添加下面一行到LocalSettings.php :

#disable section edit links for anonymous viewers
$wgDefaultUserOptions ['editsection'] = false;
From version 1.23 onwards, the section editing links need to be disabled via site-wide or user CSS, see T54811 for details on the change.
MediaWiki:Common.css: .mw-editsection { display:none!important; }

editsectiononrightclick ("0" by default) is a user right that allows editors to edit sections by right-clicking on the subheading (JavaScript feature).

Magic word

The Magic word __NOEDITSECTION__ can be used to hide all section edit links on a particular page.

This magic word is transcludable, meaning that it can be embedded in a template in order to disable section editing on all pages where this template is used.

Placing and styling section links

CSS

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

.mw-editsection