Template:Retitle

From OniGalore
Jump to navigation Jump to search

MediaWiki has a few technical limitations, which are catalogued here. One of these restrictions is that the URL for an article cannot contain spaces. Therefore, an article about Jimmy Carter must be placed at "https://en.wikipedia.org/wiki/Jimmy_Carter". As a workaround for the fact that this would lead to an article with the name "Jimmy_Carter", the MW software automatically converts the underscores in the URL to spaces in the title of the article. In other words, MW assumes that you didn't really want that underscore to be there, so it "makes it better" by giving you spaces everywhere that it see underscores. It also assumes that all page titles ought to be capitalized. Sometimes these are undesired behaviors.

For instance, our wiki has numerous pages documenting BSL commands which are lowercase and actually have underscores in their names, e.g. ai2_allpassive. If that page wasn't employing this template, its title would be "Ai2 allpassive". This is purely an aesthetic concern, of course, but it definitely looks weird. To stop MW from changing the underscores and capitalization in a page's title, you can supply your own page title with {{Retitle|proper_page_title_here}} anywhere in the markup of a page with that name, and voila! your underscore will be in its rightful place in the title and the page will start with a lowercase letter.

Note that this template actually allows you to do much more than preserve underscores and capitalization. Hypothetically, you can use it to completely re-title a page, but the abilities of this template are determined by the value of $wgRestrictDisplayTitle. If it is set to true, you cannot supply a new title that does not evaluate as "equivalent" to the old one, such as "ai_allpassive". You can only change capitalization and punctuation like the underscore. However, if $wgRestrictDisplayTitle is false, you can supply this template with any string and the page will be retitled as desired.

  • Attention: Please do not Subst: this template. MediaWiki's article-titling abilities may improve or change in the future.