New <transcludeonly> tag to determine what gets transcluded
Closed, DeclinedPublic

Description

Author: test5555

Description:
To make it easier to control what gets transcluded, it could be interesting to have an additional tag "<transcludeonly>".

Sample (1)

One could create a template:

asdf asdf <transcludeonly>123</transcludeonly> asdf asdf

When transcluded, this would display:

123


Version: unspecified
Severity: enhancement
URL: http://www.mediawiki.org/wiki/Help:Templates#Control_template_inclusion

Details

Reference
bz26095
bzimport set Reference to bz26095.
bzimport added a subscriber: Unknown Object (MLST).
bzimport created this task.Nov 24 2010, 6:08 AM

Use <includeonly></includeonly>

test5555 wrote:

Not really, a template

asdf asdf <includeonly>123</includeonly> asdf asdf

renders as:

asdf asdf 123 asdf asdf

"<onlyinclude>123</onlyinclude> asdf asdf" gives "123" when transcluded. This seems to be exactly what you want.

test5555 wrote:

Thanks Maarten, I thought this somehow existed, but couldn't find it.

Good to read that p858snake plans to document it. I would appreciate if he would write this differently though. I find his posts in this bug highly confusing.

On the other hand, it would be useful to have some tags to allow stuff to be included only when the template is transcluded, or only when substituted (and the inverse, of course), but that would be a different bug.

Add Comment