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


Author: test5555

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:


Version: unspecified
Severity: enhancement

bzimport added a project: MediaWiki-Templates.Via ConduitNov 21 2014, 11:19 PM
bzimport added a subscriber: Unknown Object (MLST).
bzimport set Reference to bz26095.
bzimport created this task.Via LegacyNov 24 2010, 6:08 AM
Peachey88 added a comment.Via ConduitNov 24 2010, 6:09 AM

Use <includeonly></includeonly>

bzimport added a comment.Via ConduitNov 24 2010, 6:15 AM

test5555 wrote:

Not really, a template

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

renders as:

asdf asdf 123 asdf asdf

Multichill added a comment.Via ConduitNov 24 2010, 8:52 AM

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

bzimport added a comment.Via ConduitNov 24 2010, 12:53 PM

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.

Dinoguy1000 added a comment.Via ConduitNov 25 2010, 1:26 AM

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