Template:Retitle: Difference between revisions

From OniGalore
Jump to navigation Jump to search
m (/cat)
(+docs)
Line 1: Line 1:
{{DISPLAYTITLE:{{#if:{{NAMESPACE}}|{{NAMESPACE}}:|}}{{{title|{{{1}}}}}}}}<noinclude>
<includeonly>{{DISPLAYTITLE:{{#if:{{NAMESPACE}}|{{NAMESPACE}}:|}}{{{title|{{{1}}}}}}}}</includeonly><noinclude>MediaWiki has a few technical limitations, which are catalogued [[wikipedia:WP:NCTR|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.
----


<center>'''''IMPORTANT!  THIS TEMPLATE SHOULD NEVER BE SUBST'D.'''''</center>
An example from our own wiki, look at the {{noredirect|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 <nowiki>{{Underscore|ai2_allpassive}}</nowiki> 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".


'''''DO NOT USE THIS UNLESS ALLOC UPDATES THE WIKI SOFTWARE'''''
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 <nowiki>{{Underscore|Using ai2_spawn}}</nowiki> and the page name would continue to display the space after "Using", while putting back the underscore that you wanted to keep.


</noinclude><noinclude>[[Category:Basic formatting templates]]</noinclude>
* '''Attention: Please do not [[wikipedia:WP:SUBST|Subst:]] this template.'''
 
[[Category:Basic formatting templates]]</noinclude>

Revision as of 00:48, 15 June 2011

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.