Change to section edit links

The default position of the "edit" link in page section headers changed in MediaWiki 1.22. The "edit" link is now positioned adjacent to the page header text rather than floating opposite it.

This page exists to disseminate information about the change, to provide editors who don't like it with a way of restoring the old appearance, and to provide guidance to developers (gadget authors, et al.) about updating code to be compatible with the new output.

What's changing

edit
 
Current position of section edit links, as they appeared on w:en:Universal grammar
 
Position of section edit links as they appear after change I6a6c12a90 was deployed.

Section edit links will be to the immediate right of section titles, instead of on the far right. If you're an editor of German, French, Italian, Polish, Japanese, or one of the other Wikipedias which already implemented this change, nothing will substantially change for you. Scripts, gadgets, screen scrapers, or other software that depends on the previous implementation of section edit links will have to be adjusted to continue working; however, nothing else should break even if they are not updated in time.

Technical information

edit

Two changes were made to the page HTML:

  • the section edit link now has class="mw-editsection" instead of class="editsection"; and
  • the section edit link is now placed after the actual headline content (<span class="mw-headline">...</span>) instead of before it.

The editsection class will for now continue to work as before, but will be removed in the future.

If you were hooking into the section edit link, or adding something to it (like some QuickEdit scripts does, or some RfD handling ones do), most likely you will only need to change editsection to mw-editsection in your code. Please note, however, that for a period of time, due to parser caching, your code might encounter pages with either of these variants and should handle both of them.

Example old and new HTML source for heading tags
Old HTML New HTML
<h2>
    <span class="editsection">...</span>
    <span class="mw-headline" id="...">...</span>
</h2>
<h2>
    <span class="mw-headline" id="...">...</span>
    <span class="mw-editsection">...</span>
</h2>

Why this is changing

edit

Related ideas for improving the structure and placement of section edit links date back years, all the way to 2009 at least. It is often difficult for new and experienced editors to track which of several potential section edit links on the far right is associated with the correct section. Many readers and anonymous or new editors may even be failing to notice section edit links at all, since they read section titles, which are far away from the links.

In 2009, the Wikipedia Usability Initiative proposed an approach where section edit links would be "moved next to the title" and icon would be added. Years later this was tested on a subset of all anonymous or registered editors to English Wikipedia, with promising results: the number of clicks on section edit links increased by 116%! (It looked like this.) Making this change was slightly more difficult than testing it however, and the associated code sat unactivated.

Now that old code like this is being cleaned up, a simpler form of this change was commited into MediaWiki, which just moves the current style of section edit links to be near the title. It is intended as less disruptive and more fitting with the current interface than the original mockup.

Timeline

edit

The change to the links' appearance is implemented in Gerrit change I6a6c12a90 (bug 41729), which was merged on April 28, 2013 and began roll out on Monday, April 29 with the regular deployment schedule. The table below details when each wiki saw the change:

Phase 1 Monday, April 29, 2013 MediaWiki.org, testwiki, test2wiki
Phase 2 Wednesday, May 1, 2013 All non-Wikipedia sites
(Wiktionary, Wikisource, Wikinews, Wikibooks, Wikiquote, Wikiversity, and a few other sites)
Phase 3 Monday, May 6, 2013 English Wikipedia
Phase 4 Wednesday, May 8, 2013 All other Wikipedias

If you don't like this change

edit

If you don't like the change, you can move the edit links to float opposite the page header by adding a short snippet of CSS to your user stylesheet (Special:MyPage/common.css on the relevant wiki) or the site-wide stylesheet (MediaWiki:Common.css on the relevant wiki):

.ltr .mw-editsection {
	float: right;
}
.rtl .mw-editsection {
	float: left;
}

If you wish to remove the additional brackets, also add the following to the same place as the above code:

.mw-editsection-bracket {
	display: none;
}