Page MenuHomePhabricator

Change header level on transclusion
Closed, DeclinedPublic

Description

Author: gunter.schmidt

Description:
When transcluding a page like {{:mypage}} the section headers of that page are included in the TOC.
Sometimes the calling page has a different header structure and basically would need all section headers
of the transcluded page one level lower.
It would be nice, if there was a function like {{:mypage|headers=+1}}.


Version: unspecified
Severity: enhancement

Details

Reference
bz9321

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 9:40 PM
bzimport set Reference to bz9321.
bzimport added a subscriber: Unknown Object (MLST).

Transclusion is not designed for this purpose. Templates should be appropriately
laid out.

ais523 wrote:

If you want to include templates at different levels like this, you can do
it with appropriate template design:

{{{header|=}}} Heading 1 {{{header|=}}}

text text text

{{{header|=}}} Heading 2 {{{header|=}}}

text text text

Here, {{template|header=}} gives a level-1 heading, {{template|header===}}
gives a level-3 heading, etc. (This example makes it level-2 by default.)

gunter.schmidt wrote:

It strikes me odd to see this request for enhancement closed with won't fix. True, MediaWiki is not designed for this, that is why
I made a request for enhancement. And I am not using templates in this case, but would like to include one article into another,
more like making a book. Kind of reusing the same article multiple times.

Anyhow, MediaWiki has grown to be a multi-purpose wiki with great work of the developers and especially people like Rob and Brion.
On the other hand, they have a quite good interest in keeping the software stick to its original purpose, powering Wikipedia and
other all-open-wikis. They do have a good point, trying to keep the software stable by keeping the complexity down and not
maintaining code, which is not of interest to these platforms.

I do agree, this is a minor enhancement, that would be used only by very few people. On the other hand, I have seen quite
understandable requests that have been closed just as fast. I am wondering if there is a community consensus discussion on the
further development of this beautiful software.

Maybe it would be a good idea, to think of an enterprise branch which will focus on these specific needs found there. Following the
discussions on the mailing lists and wikimania, there seems to be quite an interest developing. But this is probably not the right
place to discuss this.

Just my humble opinion.

ssanbeg wrote:

The good news is that since it could be implemented as an extension, there's no
reason to implement it in the core code, anyway. Maybe if there's enough desire
for it on one project, someone could implement it in that project.