Last modified: 2011-03-13 18:04:29 UTC
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.
See a live demo at http://en.wikipedia.org/wiki/User:Schneelocke/Temp (article) http://en.wikipedia.org/wiki/Template:Template_for_testing (template)
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
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).
OK - thanks for your comments.