Transclusion should produce tree-like results in "What links here"
OpenPublic

Assigned To
None
Priority
Low
Author
bzimport
Subscribers
Nemo_bis, Whatamidoing-WMF, He7d3r and 7 others
Projects
Tokens
"Like" token, awarded by Fauzan."Like" token, awarded by Kozuch."Love" token, awarded by DiegoQueiroz."Love" token, awarded by He7d3r.
Reference
bz3241
Description

Author: dungodung

Description:
Since Redirects are shown in a different fashion in the "What links here" pages,
I think it would be good to show the template relations in the same manner.

For instance, there is a template {{foo}} and pages [[bar]], [[baz]] and [[bat]]
contain the template. Now, the template itself contains a link to, say,
[[quux]]. Therefore, the three aforementioned articles (ba*) contain the link
[[quux]]. In the "What links here" page for [[quux]], the result should be
treelike, resembling redirects:

The following pages link to here:
View (previous 50) (next 50) (20 | 50 | 100 | 250 | 500).
*[[quuxx]] (redirect page)
[[Xyzzy]]
*[[Template:foo]] (template page)
[[bar]]
[[baz]]
[[bat]]
*[[shme]]


Version: unspecified
Severity: enhancement
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=1392
https://bugzilla.wikimedia.org/show_bug.cgi?id=12396

bzimport added a project: MediaWiki-Special-pages.Via ConduitNov 21 2014, 8:46 PM
bzimport added a subscriber: wikibugs-l.
bzimport set Reference to bz3241.
bzimport created this task.Via LegacyAug 23 2005, 2:15 PM
bzimport added a comment.Via ConduitMay 10 2007, 7:47 PM

iano wrote:

I agree. Any solution which eliminates or distinguishes links brought in by Templates would be helpful.

My use case is determining which of several articles to be merged is most popular. Links brought in by
templates can swamp the results. Example: pages [[Production battery electric vehicle]] and [[List of
production battery electric vehicles]], one of which includes [[Template:Energy related development]]
which completely swamps the "what links here" results with its hundred links.

bzimport added a comment.Via ConduitMay 11 2008, 6:09 PM

rasamassen wrote:

Another option would be to have a link to Show/Hide Direct and Indirect transclusions.

Nemo_bis added a comment.Via ConduitFeb 10 2009, 11:43 PM

See also bug 13087.

bzimport added a comment.Via ConduitJan 12 2010, 12:20 AM

apoc2400 wrote:

More simple would be to have a way to hide all links that are not simple links in the actual wikitext of the articles. That would also hide links from templates such as {{cite news|...|authourlink=John Smith}}, but I think that is acceptable. All those navigation boxes are really swamping "What links here", at least on English Wikipedia.

bzimport added a comment.Via ConduitJan 18 2011, 3:56 AM

hpvpp wrote:

Would it be possible to make the filter be sensitive to the status of the "show/hide" button on a template, i.e. show the links from a transcluded template only when the template is actually shown and hide those links otherwise?

DanielFriesen added a comment.Via ConduitJan 18 2011, 4:07 AM

Right now transclusions are extracted as the parser parses the page. In other words, even though a template may be excluded by another template, because we are calculating these in this way there's no real difference between a template that was directly transcluded and one which was transcluded by another template (and of course what templates another template transcludes can differ based on what page they are transcluded into and if they are transcluded).

The first step here, would probably be to make use of the preprocessor $frame to try and differentiate between direct and indirect transclusions when building the parser output. There is a slight chance we might be able to export a bit more of the tree of information from that I suppose.

..then we can argue what the best ui for exposing that information is.

Krinkle added a comment.Via ConduitJan 18 2011, 7:48 PM

Aside from it not being possible with the current system, there's also the matter of deciding what is made by what.

A link in a template would be deeper in the tree than the template itself. However what about stuff like this:

[[Article]]

{{Sometemplate

param=Foobar

}}

[[Template:Sometemplate]]

Check out [[{{param}}]]

Etc. you can imagine the possiblities and dependencies. It's hard and depends on point of view to say that a link is "from a template" as there are dynamic dependencies both up and down the tree that may change things.

I'm thinking a WONTFIX...

bzimport added a comment.Via ConduitJan 18 2011, 11:18 PM

hpvpp wrote:

Not being able to filter out links originating from templates makes the "what links here" useless for pages containing such templates. If the functionality was created to assist editors (which I think is safe to assume) then it clearly was not thought through properly before being implemented. And if that is indeed the case then a WONTFIX would be a blatant disregard of responsibility.

PrimeHunter added a comment.Via ConduitJan 19 2011, 2:09 AM

At [[Wikipedia:Village pump (technical)/Archive 69#What links here and navboxes]] I suggested a relatively simple sounding version: An option to hide pages that would not have linked if no transclusions had been performed on them. This seems good enough for most purposes to me, and a big improvement over the current options.

Krinkle added a comment.Via ConduitJan 19 2011, 10:42 AM

(In reply to comment #9)

At [[Wikipedia:Village pump (technical)/Archive 69#What links here and
navboxes]] I suggested a relatively simple sounding version: An option to hide
pages that would not have linked if no transclusions had been performed on
them. This seems good enough for most purposes to me, and a big improvement
over the current options.

That means links made by the article but through transclusion won't be shown.
eg. links by {{user2}} or {{Infobox}}. (although that could be an acceptable loss)

But aside from that illogical and inconsistant behaviour that will undoubltly occur, I don't think it's technically possible.

If Article A has a template call to {{Foo}}.
{{Foo}} contains a link to Article B.

Then on Article B will be WhatLinksHere:

  • Article A
  • Template:Foo

This can't be avoided in any way since when the page is saved the entire parsing of it is put into the pagelinks table, when getting WhatLInksHere one can't filter out indirect links.

but although incoming links can't be distinguished, outgoing links can. So in the futuristic "What leaves here" (bug 26757) there could be an option (if really needed) to "Hide/Show indirect links" (page-, template- and filelinks). Correct me if I'm wrong, but for incoming links this is next to possible unless a really big change is made in the database schema.

He7d3r awarded a token.Via WebNov 24 2014, 12:46 PM
DiegoQueiroz awarded a token.Via WebNov 26 2014, 5:12 PM
Kozuch awarded a token.Via WebDec 17 2014, 8:35 PM
Fauzan awarded a token.Via WebMar 25 2015, 4:49 PM
Reguyla moved this task to What links here on the MediaWiki-Special-pages workboard.Via WebTue, May 26, 2:24 AM

Add Comment