Page MenuHomePhabricator

Wikilink in template not recognized
Closed, DeclinedPublic

Description

Author: bugzilla.wikimedia

Description:
The following template/article combination is not processed correctly:


Template contents: [[{{{1}}}|]]

Article contents: {{Template|Main page}}


This should result in a link to the Main page (à la [[Main page|]]); however,
instead of the link, the unparsed text is inserted into the article. Removing
the | or adding text after it causes the template contents to be parsed and
interpreted correctly.


Version: unspecified
Severity: minor
OS: Windows XP
Platform: PC
URL: http://en.wikipedia.org/wiki/User:Schneelocke/Temp

Details

Reference
bz860

Revisions and Commits

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 7:03 PM
bzimport set Reference to bz860.
bzimport added a subscriber: Unknown Object (MLST).

gangleri wrote:

Dear friends,

I identified the following:
a) "Main page" does not have have a prefix. What should [[Main page|]] be?
The same also with [[Esperanto|]] and other articles of the main namespace.

b) It would work with [[:fr:Main Page]], [[:fr:Main Page|]] but please
note, that normaly "Page" is only redirected with capital "P" in other
Wikipedias and [[:fr:Main page]], [[:fr:Main page|]] will fail. Maybe this
should be changed.

c) More problematicaly is, that the template does not work with somethink
like <nowiki>{{template_name|User:user_name}}</nowiki>.
You can find many examples at
http://en.wikipedia.org/wiki/User:Gangleri/tests/temp_2 and
http://test.wikipedia.org/wiki/User:Gangleri/tests/temp_2 .

d) I could not find a workaround changing the template to somthink like
<nowiki>[[{{{1}}}|{{{2}}}]]</nowiki> as available at
http://en.wikipedia.org/wiki/Template:Template_for_testing_3 and
http://test.wikipedia.org/wiki/Template:Template_for_testing_3 and using an
empty seccond parameter.

These examples are available at
http://en.wikipedia.org/wiki/User:Gangleri/tests/temp_3 and
http://test.wikipedia.org/wiki/User:Gangleri/tests/temp_3 .

Regards Reinhardt

rowan.collins wrote:

There is a very simple explanation for this: the "pipe trick" (where
[[Namespace:Title|]] becomes [[Namespace:Title|Title]]) is processed when the
page is *saved* (or previewed), not when it is *rendered*. So using it in
combination with a template has no meaning, and is quite rightly treated as
invalid syntax.

As far as I know, there is only one way to achieve the desired effect, and that
is to have two parameters, perferably named, so that {{template
name|linkto=User:Foo|linkas=Foo}} can become [[User:Foo|Foo]]. In many cases, it
will actually be the *first* parameter that is redundant, since you will be able
to say {{template|user=Foo}}, having defined the template as
"[[User:{{{user}}}|{{{user}}}]]".

I'm going to close this as "wontfix", because it seems to me to be a very minor
problem (very few circumstances where this would be needed) which would require
a rather major change to the software (processing of [[Foo:Bar|]] as valid
syntax during rendering, not just substituting it on save).

bugzilla.wikimedia wrote:

OK - thanks for your comments.

epriestley added a commit: Unknown Object (Diffusion Commit).Mar 4 2015, 8:14 AM
epriestley changed the task status from Declined to Resolved by committing Unknown Object (Diffusion Commit).Mar 4 2015, 8:20 AM
epriestley added a commit: Unknown Object (Diffusion Commit).
Aklapper changed the task status from Resolved to Declined.Mar 4 2015, 11:40 AM
Aklapper claimed this task.