I’ve created a few templates on our WIKI and I have a basic understanding of how they work. I have one template I’m working on right now that refuses to behave, at least not the way I expect it to. The purpose of the template is to format a external link in a consistent way. The name of the template is “NSURL”
Here is the template markup:
[{{{1}}} Go…]
I’m using it like this:
{{NSURL | https://www.somesecreturl.com}}
When I use the template it prints it out just like the raw template markup. If I replace {{{1}}} with a static URL it works correctly:
[http://www.yahoo.com Go…]
—– Version Info —–
MediaWiki 1.15.1
PHP 5.2.6-1+lenny3 (apache2handler)
MySQL 5.0.51a-24+lenny1
@Steve K – here’s my code for an external link to a Wikipedia URL:
Use:
{{Wikipedia|Agile}}gives Agile{{Wikipedia|Agile_software_development|Agile software development}}gives Agile software developmentSee also notes below regarding special characters like ? etc.
Update: if you have Extension:StringFunctions you can use #replace in the second example. This means that the URL will replace spaces with underscores. So the code in the template will be:
and on the page you only need:
{{Wikipedia|Agile software development}}