I use a quotation template in my wiki and for years it's been bugging me that external links don't always show up as they should, when used within templates. More often than not a simple {{{1}}} or {{{2}}} occur instead of the expected external link.
Now it seems I've traced what seems to be the root of the problem.
A URL like this one : http://web.archive.org/web/20061219205042/http://www.dis-danmark.dk/sydfyn/H...
works well : [ http://web.archive.org/web/20061219205042/http://www.dis-danmark.dk/sydfyn/H...] shows up as a correct external link showcasing "source" highlighted in light blue.
A URL like this one : http://www.dis-sydfyn.dk/viewpage.php?page_id=4
does not work : [http://www.dis-sydfyn.dk/viewpage.php?page_id=4 source] shows simply as {{{2}}}
The differences in the two URLs are the use of the characters "?" and "=" in the latter case. If these are replaced by "/" the external link is highlighted, but of course won't lead one anywhere.
Case in question : http://notatwiki.dk/index.php?title=Rejsen_til_Amerika
The template itself is pretty straightforward. It uses to variables and contains only this bit of HTML and MediaWiki markup :
<blockquote class="toccolours" style="line-height: 1.5em;"> <div style="text-align=left";>{{{1}}}</div> <div style="text-align: right; font-style:normal;">{{{2}}}</div> </blockquote>"
Any ideas for a remedy to make these URL's work in templates?
Raw links seem(!) to work regardless of what characters they contain, so the problem seems related to the [ ] containment of the URL.
Yours Sincerely, Morten Blaabjerg
-- Fri software (fri som i ytringsfrihed, ikke som i gratis) er efter min mening et af de allervigtigste spørgsmål i vores tid. Jeg støtter derfor Free Software Foundations arbejde for udbredelsen af fri software : http://fsf.org/
Læs mere om hvorfor dette er så vigtigt her : http://www.gnu.org/philosophy/why-free.html
On 2011-02-22T05:49, Morten Blaabjerg mortenblaabjerg@gmail.com wrote:
does not work : [http://www.dis-sydfyn.dk/viewpage.php?page_id=4 source] shows simply as {{{2}}}
Hello Morten,
The equals symbol is used for assignment in MediaWiki's markup, so you're assigning the value "4 source]" to the parameter {{{[http://www.dis-sydfyn.dk/viewpage.php?page_id%7D%7D%7D. (Such a strange parameter name would actually work, too.)
The solution is to make the parameter explicit: {{quote |2=http://www.dis-sydfyn.dk/viewpage.php?page_id=4%7D%7D or {{quote |link=http://www.dis-sydfyn.dk/viewpage.php?page_id=4%7D%7D.
-- Yours cordially, Jesse (Pathoschild)
Jesse, thank you very much for enlightening me! Your remedy (adding "2=" to the template) works like a charm.
Seems I was completely off track in my speculations as to the root of the problem. Not so easy to figure out on your own, and yet it hasn't been a major problem, so I didn't get around to posting it here until now.
Thanks again!
Best wishes, Morten Blaabjerg
On Tue, Feb 22, 2011 at 3:44 PM, Jesse (Pathoschild) pathoschild@gmail.comwrote:
On 2011-02-22T05:49, Morten Blaabjerg mortenblaabjerg@gmail.com wrote:
does not work : [http://www.dis-sydfyn.dk/viewpage.php?page_id=4 source] shows simply as {{{2}}}
Hello Morten,
The equals symbol is used for assignment in MediaWiki's markup, so you're assigning the value "4 source]" to the parameter {{{[http://www.dis-sydfyn.dk/viewpage.php?page_id%7D%7D%7D. (Such a strange parameter name would actually work, too.)
The solution is to make the parameter explicit: {{quote |2=http://www.dis-sydfyn.dk/viewpage.php?page_id=4%7D%7D or {{quote |link=http://www.dis-sydfyn.dk/viewpage.php?page_id=4%7D%7D.
-- Yours cordially, Jesse (Pathoschild)
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org