[OSM-talk] Modifying variable in wiki
Konrad Skeri
konrad at skeri.com
Thu Aug 6 14:13:25 BST 2009
>> How do I modify a variable in a template on the wiki.
>>
>> In the Swedish version of the place-template there's a link to a
>> weather site with forecasts for the city. Works for all Swedish cities
>> as long as there is no space in the area name. However, for Vastra
>> Gotaland the url of the area part to the weather site has to be
>> Vastra_Gotaland. Is there a simple way to handle this (changing spaces
>> to _) within the wiki-templare, or do I have to pass a url-friendly
>> area name as a variable?
>
> Maybe the anchorencode function is what you need?
>
> http://www.mediawiki.org/wiki/Help:Magic_words
>
That seems to work with one exception - it doesn't handle non-English
characters in the same way as urlencode, so I'm getting invalid URLs
for e.g. "Västra Götaland". I've also tried nesting them without any
useful results.
Konrad
More information about the talk
mailing list