Last modified: 2014-07-27 22:20:26 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 3241 - Transclusion should produce tree-like results in "What links here"
Transclusion should produce tree-like results in "What links here"
Status: NEW
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
All All
: Low enhancement with 10 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2005-08-23 14:15 UTC by Filip Maljkovic [Dungodung]
Modified: 2014-07-27 22:20 UTC (History)
13 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Filip Maljkovic [Dungodung] 2005-08-23 14:15:02 UTC
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)
 *[[Template:foo]] (template page)
Comment 1 Ian Osgood 2007-05-10 19:47:50 UTC
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.
Comment 2 TRas 2008-05-11 18:09:54 UTC
Another option would be to have a link to Show/Hide Direct and Indirect transclusions.
Comment 3 Nemo 2009-02-10 23:43:14 UTC
See also bug 13087.
Comment 4 apoc2400 2010-01-12 00:20:29 UTC
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.
Comment 5 hpvpp 2011-01-18 03:56:25 UTC
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?
Comment 6 Daniel Friesen 2011-01-18 04:07:16 UTC
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.
Comment 7 Krinkle 2011-01-18 19:48:28 UTC
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]]

## [[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...
Comment 8 hpvpp 2011-01-18 23:18:22 UTC
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.
Comment 9 Jens K Andersen 2011-01-19 02:09:31 UTC
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.
Comment 10 Krinkle 2011-01-19 10:42:57 UTC
(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.

Note You need to log in before you can comment on or make changes to this bug.