Page MenuHomePhabricator

Categorizing and wikilinking with the Pipe
Closed, DeclinedPublic

Description

Author: matthiasbecker1967

Description:
It seems there's no way of categorizing articles by using a template's parameter if the value needs to be shortened for the article's output like <nowiki>[[Foo (a word)|Foo]]</nowiki> since <nowiki>[[Foo (a word)|]]</nowiki> does not parse as <nowiki>[[Foo]]</nowiki> when this construction is used involving a template. Hence it isn't possible to use one parameter value as a criteria for categorizing as well as showing this same parameter value wikilinked in the article output.

Since I don't know if I could explain what I mean here a particular example which also explains why this is a problem:

If one would have a parameter with the value ''County=Washington County (Oregon)'' the syntax <nowiki>[[{{{County}}}|]]</nowiki> will not result as <nowiki>[[Washington County (Oregon)|Washington County]]</nowiki> normally would but it will show <nowiki>[[Washington County (Oregon)|]]</nowiki> (however, if you you're setting ''County=Washington County (Oregon)|Washington County'' the linking works) ... if now one wants to categorize an article by using the template parameter value -- in the given example the syntax would be ... [[:Category:{{{County}}}]]... -- you need the parameter without Wikilinks because (in this example) <nowiki>[[Category:{{{County}}}|]] would not have the intended result. (See [http://de.wikipedia.org/w/index.php?title=Vorlage:Infobox_Ort_in_den_Vereinigten_Staaten&diff=next&oldid=59752142 this] for what I did in the specific case in the template, [http://de.wikipedia.org/w/index.php?title=Houston&diff=59734396&oldid=59548860 here] is my earlier edit in the infobox and [[File:Infobox USA DE county 2009.jpg|this image]] shows the unwished result.) --~~~~


Version: unspecified
Severity: normal

Details

Reference
bz18857

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 10:41 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz18857.
bzimport added a subscriber: Unknown Object (MLST).

This is because shortcuts like [[Foo (word)|]] are expanded to [[Foo (word)|Foo]] on save time, not on parse time: it's done in a phase called pre-save transform or PST, in which ~~~~ is also expanded.