{{localurl:}} and {{localurle:}} were originally intended for use only in the HTML sections of the language files. But since they were introduced, they've become popular in wikitext, for example to generate an edit URL for an arbitrary page, the title of which is specified in a template parameter. Unfortunately, they're poorly suited for this use, since wikitext requires absolute URLs. It doesn't understand local URLs, like anchor tags in HTML do. The standard workaround is to use this:
{{SERVER}}{{localurl:page}}
but as Mormegil pointed out to me on IRC, that breaks if page is an interwiki link. Interwiki URLs are always absolute. The standard solution used in the MediaWiki API is to use the Title::getFullURL() function. Accordingly, I've implemented an interface to this function, {{fullurl:}}. So instead of the above, you can use:
{{fullurl:page}}
For completeness, I also implemented {{fullurle:}}, but it has no practical applications that I can think of. Please use {{fullurl:}} and {{localurl:}} in wikitext, not the escaped counterparts. Escaped URLs only work in wikitext because of an ugly backwards-compatibility hack.
-- Tim Starling
On 23/09/05, Tim Starling t.starling@physics.unimelb.edu.au wrote:
solution used in the MediaWiki API is to use the Title::getFullURL() function. Accordingly, I've implemented an interface to this function, {{fullurl:}}. So instead of the above, you can use:
I've updated http://meta.wikimedia.org/wiki/Help:Variable to mention this new variable; ugly page, but it might as well be up to date ish ;) [It might be an idea to mention which versions this works on; have you only committed it to head, or will it work on updates to 1.5 or 1.4 as well?]
For completeness, I also implemented {{fullurle:}}, but it has no practical applications that I can think of. Please use {{fullurl:}} and {{localurl:}} in wikitext, not the escaped counterparts. Escaped URLs only work in wikitext because of an ugly backwards-compatibility hack.
I've tried to mention this in the Help page too, because people have been wondering about it.
-- Rowan Collins BSc [IMSoP]
wikitech-l@lists.wikimedia.org