This page looks best with JavaScript enabled

Please use recentchanges

 ·  ☕ 5 min read

A brand-new MediaWiki instance comes with a default sidebar. In MediaWiki 1.41, that sidebar looks something like this:

* navigation
** mainpage|mainpage-description
** recentchanges-url|recentchanges
** randompage-url|randompage
** helppage|help-mediawiki
* SEARCH
* TOOLBOX
* LANGUAGES

Here’s how it looks rendered:1

And if you have interface admin rights, you can edit it at MediaWiki:Sidebar.

This is great and I encourage you to edit your sidebar as one of the first things you do in your new wiki! But please, please, please, leave the text recentchanges there.

How recentchanges works

Every display string (on the right-hand-side of the |) at MediaWiki:Sidebar is secretly a system message. So you can edit MediaWiki:recentchanges to change the display text for the recentchanges-url link, MediaWiki:mainpage-description for the mainpage link, etc.

Using these built-in links comes with some advantages:

You can tell if the hotkey is working either by pressing it or hovering the link:

How to customize your recentchanges text

Some wikis want to print Recent Changes instead of Recent changes, Main Page instead of Main page, etc (i.e. they want Title Case instead of Sentence case). This is totally fine!

But do NOT write ** recentchanges-url|Recent Changes in your Sidebar message. Instead, navigate to MediaWiki:recentchanges and edit the display text there to say Recent Changes.2

If you do this wrong then:

  1. Translation of the interface to other languages won’t work
  2. Alt+Shift+R will stop working as a hotkey

But if you do this right then you’ll customize only the English UI, and the hotkey will be preserved!

EVERY string at MediaWiki:Sidebar is a message

Let’s say we want to make all our text lowercase. So we’re going to write this:

* navigation
** mainpage|mainpage-description
** recentchanges-url|recent changes <!-- incorrectly writing out the text `recent changes` -->
** randompage-url|randompage
** helppage|help-mediawiki

But then we can go to MediaWiki:recent_changes and edit it:

And yep, the sidebar will reflect our change:

You can use your own messages!

If you want to support multiple languages with your interface text, you can absolutely create and edit your own interface messages in your sidebar! For example, you could write:

sidebar-gameinfo
* Items|sidebar-items
* Spells|sidebar-spells

Then you can make the following interface pages:

  • In English:
    • MediaWiki:sidebar-gameinfo with content Gameplay
    • MediaWiki:sidebar-items with content Items
    • MediaWiki:sidebar-spells with content Spells
  • In Polish:3
    • MediaWiki:sidebar-gameinfo/pl with content Rozgrywka
    • MediaWiki:sidebar-items/pl with content Przedmioty
    • MediaWiki:sidebar-spells/pl with content Zaklęcia

You can also use a system message for the link target. For example, the following is valid:

* submit-ticket-link|submit-ticket
  • MediaWiki:submit-ticket-link is a link to your servicedesk portal
  • MediaWiki:submit-ticket says Submit ticket
  • MediaWiki:submit-ticket/pl says Wyślij zgłoszenie3

You can then reuse the message submit-ticket-link throughout your wiki using the {{int:}} magic word (for example, {{int:submit-ticket-link}}). Then, if you start using a different portal, you can change the link in one single location and affect your entire wiki.

Addendum: using text-transform

Note: This is not recommended if your wiki is used by multilingual users, as English is pretty much the only language to use Title Case in titles.

There’s a cool CSS property called text-transform.4 It’s most often used when you want all-caps titles or headings with the value text-transform:uppercase; but it also has a value called capitalize that transforms text to Forced Title Case.

This is not by any means a perfect solution for all situations because there will probably be some words you want lowercased (e.g. Submit a Ticket not Submit A Ticket), and the set of words you want lowercased depends on your style guide (e.g. there is debate about whether you capitalize the word “about”).5 It gets pretty complicated, too, as the capitalization rule may depend not only on your particular style guide but also:

  • Its position in the title (e.g. you always capitalize the first word)
  • Its part of speech (e.g. “about” can be an adverb, adjective, or preposition)
  • Whether it’s part of a proper noun (e.g. in the title “On Skylock’s Role in The Merchant of Venice”, you capitalize the “The” that is part of the play’s name, even though normally in this case “the” would be lowercased)6

Some title-case converters exist, but they will often make mistakes because they don’t understand context, and you still need to specify a style guide.

Needless to say, CSS is not capable of correctly converting to title case. But it can do capitalize, which just capitalizes the first letter of every word no matter what, and since MediaWiki sidebars often have no prepositions, articles, conjunctions, or other parts of speech that get lowercased (sometimes), you will likely be fine applying this rule to your entire sidebar:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
/* For classic vector */
.vector-menu-heading-label,
.mw-list-item > a > span {
    text-transform:capitalize;
}

/* For vector 2022 */
.vector-menu-heading,
.mw-list-item > a > span {
    text-transform:capitalize;
} 

Conclusion

Please make sure the text * recentchanges-url|recentchanges is in your sidebar somewhere or I’ll be really sad.


  1. Note, Cargo’s “Page values” link is called “Cargo data” in the most recent version of Cargo. ↩︎

  2. I wanted to say something accurate about how Fandom wikis handle this because I know their setup is different, but it turns out that their default navigation doesn’t make use of system messages for anything, let alone to include a recent changes link. I do not recommend that approach. ↩︎

  3. Thanks Alex for translating this for me ↩︎ ↩︎

  4. Thanks to Elm from Palia Wiki for pointing out to me that text-transform was worth mentioning here ↩︎

  5. At a previous job, I was in charge of picking a style manual and I picked Chicago for the specific reason that they lowercase “about” when it’s a preposition. I do not like capitalizing prepositions in titles no matter how long the word is. ↩︎

  6. And now you know why my blog uses Sentence casing for all my article titles 🙂 ↩︎

Share on

river
WRITTEN BY
River
River is a developer most at home in MediaWiki and known for building Leaguepedia. She likes cats.

What's on this Page