Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

I am trying to create a linkage between two media wiki. Specifically, a template that links to an specific article on the other wiki.

I would like to write

See {{otherwiki|Some thing}}

The template otherwiki should convert the above to

[http://linkto.other.wik/Some_thing Some thing]

The template I wrote works pretty well for single-word terms, and it works if I write Some_thing, but I can't get it to work for phrases that contain whitespace.

[https://en.bitcoin.it/wiki/{{{1}}} {{{1}}}]

How do I fix the above template to make it support whitespace?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

One option would be to set up interwiki links to the target wiki. With that, you can either write your links directly as e.g. [[otherwiki:Some thing|]], or you can encapsulate that into a template ([[otherwiki:{{{1}}}|]]), so the syntax would be exactly as you wanted.

Another option is to use the magic word {{urlencode}}:

[https://en.bitcoin.it/wiki/{{urlencode:{{{1}}}|WIKI}} {{{1}}}]
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.