Transclusion should produce tree-like results in "What links here"
Open, LowPublic

Subscribers
Tokens
"Grey Medal" token, awarded by Dalba."Like" token, awarded by Fauzan."Like" token, awarded by Kozuch."Love" token, awarded by DiegoQueiroz."Love" token, awarded by He7d3r.
Assigned To
None
Authored By
dungodung, Aug 23 2005

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

Details

Reference
bz3241
bzimport set Reference to bz3241.
bzimport added a subscriber: Unknown Object (MLST).

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.

rasamassen wrote:

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

See also bug 13087.

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.

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?

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.

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...

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.

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.

(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.

RP88 added a subscriber: RP88.Jul 17 2015, 2:25 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 17 2015, 2:25 PM

Add Comment