Last modified: 2014-11-17 09:21:34 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T23339, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 21339 - Transclusion from pages built by a template
Transclusion from pages built by a template
Status: REOPENED
Product: MediaWiki extensions
Classification: Unclassified
LabeledSectionTransclusion (Other open bugs)
unspecified
All All
: Normal enhancement with 4 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 69736 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-10-29 05:35 UTC by Jamie Hari
Modified: 2014-11-17 09:21 UTC (History)
7 users (show)

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


Attachments

Description Jamie Hari 2009-10-29 05:35:52 UTC
As it stands, if you have two pages, A and B...

A:

<section begin=chapter1 />this is a chapter<section end=chapter1 />

B:

{{#lst:A|chapter1}}


You will get the expected results. :)


Now suppose if you have three pages, A, B and C...

A:

<section begin=chapter1 />this is a chapter<section end=chapter1 />

B:

{{:A}}

C:

{{#lst:B|chapter1}}


This does not currently work. Page C shows nothing from Page A.
Here is just one example of why this would be handy:


Page A is a template. (Protected)

Page B is a templated article, using template Page A. This page describes a type of wine. (Not Protected)
(Ex. Chateau Sanbeg, Chardonnay, White, $12.00, 14%)

Page C is a very similarly templated article, but described a variant of Page B.
(Ex. Chateau Sanbeg, 2008, Chardonnay, White, $13.00, 14%)

For each wine (Page B), there could be dozens of 'vintages' or variants. (2005,2006,2007,2008,etc)
Rather than having to type out the common elements to Page B, over and over, in all of the numerous Page Cs, it would be great to be able to have them pulled in from Page B. Having the section begin/end tags in Page B is inefficient and since it is unprotected allows the possibility that it will be broken by a poor user edit. Placing the tags directly in Page A would hide the magic under the hood.

In effect... a double hop transclusion.

I am willing to help in any way needed to make this new feature possible.
Comment 1 Steve Sanbeg 2009-11-15 05:05:28 UTC
The extension works by retrieving the template, extracting the section, and then doing the normal parse, which would cause any templates in the section to be transcluded.  This feature would require doing some kind of recursive template substitution before extracting sections and parsing, which make make it slower without being useful for the normal case.  But this does come up form time to time, so it may be useful to have either another function or an argument to the existing function to do this.
Comment 2 Eliyahu Neiman 2010-01-31 06:04:42 UTC
This has come up in the context of transcluding Bible verses at [[ws:Template:Bible/Leviticus]]. Right now that template won't work right for [[ws:Bible (Jewish Publication Society 1917)/Leviticus]] unless every verse is *individually* transcluded from Page space (having content transcluded from Page space is current best practice at Wikisource) and marked with a section tag. This process cannot even be assisted by a template, because section tags can't be transcluded!
Comment 3 Eliyahu Neiman 2010-02-03 03:15:20 UTC
Perhaps it would be appropriate to first recursively transclude *only* #section transclusions. In this way, the entire page A could be transcluded to page B with {{#section:A}}, and the extension would pick up on that when processing page C. Also, it would be important for the extension to retain the <section> tags at the beginning and end of a section transclusion, so that the section could be re-transcluded elsewhere.
Comment 4 Mario 2010-11-28 22:14:34 UTC
"Any news on getting this extension to work from within a template? That would dramatically upgrade its functionality!" Ethan1701 11:09, 3 October 2010 (UTC
) - http://www.mediawiki.org/wiki/Extension_talk:Labeled_Section_Transclusion#Templates
Comment 5 Mario 2010-11-28 22:14:56 UTC
"Any news on getting this extension to work from within a template? That would dramatically upgrade its functionality!" Ethan1701 11:09, 3 October 2010 (UTC
) - http://www.mediawiki.org/wiki/Extension_talk:Labeled_Section_Transclusion#Templates
Comment 6 Bugmeister Bot 2011-08-19 19:12:43 UTC
Unassigning default assignments. http://article.gmane.org/gmane.science.linguistics.wikipedia.technical/54734
Comment 7 Merlijn van Deen (test) 2012-11-02 09:32:52 UTC
The following changeset implements this feature:

https://gerrit.wikimedia.org/r/#/c/31330/
Comment 9 Andre Klapper 2013-07-23 09:10:23 UTC
Patch got reverted - removing keyword.
Comment 10 Merlijn van Deen (test) 2014-08-19 10:13:02 UTC
*** Bug 69736 has been marked as a duplicate of this bug. ***
Comment 11 Merlijn van Deen (test) 2014-08-19 10:14:36 UTC
Adding Guillaume Paumier's example from #69736:

> When the labeled section is located inside a template call, you can't
> transclude it.
> 
> Example on PageX: {{green|<section begin="foo"/>bar<section end="foo"/>}}
> 
> Then {{#lst:PageX|foo}} doesn't show anything.
> 
> This is a bit of a bummer when the text you want to transclude in wrapped in
> a formatting template.
Comment 12 Merlijn van Deen (test) 2014-08-19 11:35:41 UTC
URL is no longer functional.

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


Navigation
Links