Template:Retitle: Difference between revisions

From OniGalore
Jump to navigation Jump to search
(+docs)
m (Iritscen moved page Template:Underscore to Template:Retitle without leaving a redirect: This template can either totally retitle an article or else it can only alter things like an underscore in the title, depending on $wgRestrictDisplayTitle, ...)
(No difference)

Revision as of 20:17, 23 May 2013

MediaWiki has a few technical limitations, which are catalogued HERE. One of these restrictions is that the URL for an article cannot contain spaces. As a "smart" workaround for the fact that this would lead to articles with names like "Jimmy_Carter", the MW software automatically converts the underscores in the URL to spaces in such places as the title of the article at the top of the page. 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 can. Sometimes this is undesired behavior.

An example from our own wiki, look at the ai2_allpassive page. Ignoring that this is a redirect page, notice that the page title is displayed with a space in it, even though the underscore actually belongs there. This is purely an aesthetic concern, of course, but it definitely looks weird. To fix such a page, you would put {{Underscore|ai2_allpassive}} anywhere in the markup, and voila! your underscore is in its rightful place in the title. Note that you cannot supply a new title that does not evaluate as "equivalent" to the old one, such as "ai_allpassive".

Note that this template is not a simple reversal of MW's "smart fix"; if you have a page called, let's say, "Using ai2_spawn", you would write {{Underscore|Using ai2_spawn}} and the page name would continue to display the space after "Using", while putting back the underscore that you wanted to keep.

  • Attention: Please do not Subst: this template.