Sweet! That works for me. I had already followed other directions to
allow mediawiki to interpret the file:/// protocol. I installed
Stringfunctions:
http://www.mediawiki.org/wiki/Extension:StringFunctions#Installation.
And i modified your code a little bit:
[{{#replace:file:///{{{1}}}||%20}} {{{2|}}}]
So now only the path is needed, and the template will add in the
file:/// part for me. This doesn't have a dialog like the filelink
extension:
http://www.mediawiki.org/wiki/Extension:FileLink
However, this one works the way it should the 1st time. Filelink doesn't
seem to be getting very much love, maybe someone can fix it up a bit at
somepoint and bring it inline with the current MW version.
Michael Daly wrote:
Matt Long wrote:
I found that the urlencode gives you a + sign for
every space,
so there must be a way to get a %20 instead.
If you use StringFunctions - an extension to ParserFunctions - you could
do this with a template. Just create a template that takes an external
link and uses the #replace function to replace all blanks with %20. By
putting this in an extension, your users will not have to do much.
Something like:
{{extlink|http://example.com/problem stuff|description}}
would pump out:
[
http://example.com/problem%20stuff description]
The template would be:
[{{#replace:{{{1}}}||%20}} {{{2|}}}]
I tested it minimally and it seems to work.
Mike
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l