Special characters in URLs in templates

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Special characters in URLs in templates

Morten Blaabjerg-3
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/Historier/Amerika/rejsen_til_amerika.htm

works well : [
http://web.archive.org/web/20061219205042/http://www.dis-danmark.dk/sydfyn/Historier/Amerika/rejsen_til_amerika.htmsource]
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
_______________________________________________
MediaWiki-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Special characters in URLs in templates

Jesse (Pathoschild)
On 2011-02-22T05:49, Morten Blaabjerg <[hidden email]> 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}}}. (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}} or {{quote
|link=http://www.dis-sydfyn.dk/viewpage.php?page_id=4}}.

--
Yours cordially,
Jesse (Pathoschild)

_______________________________________________
MediaWiki-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Special characters in URLs in templates

Morten Blaabjerg-3
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)
<[hidden email]>wrote:

> On 2011-02-22T05:49, Morten Blaabjerg <[hidden email]> 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}}}. (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}} or {{quote
> |link=http://www.dis-sydfyn.dk/viewpage.php?page_id=4}}.
>
> --
> Yours cordially,
> Jesse (Pathoschild)
>
> _______________________________________________
> MediaWiki-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
_______________________________________________
MediaWiki-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l