Jump to content

Help talk:Labeled section transclusion

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Gadget850 (talk | contribs) at 14:43, 24 July 2014 (Is labeled section transclusion useful only when there are more than one labeled sections to transclude?: Sounds about right). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Documenting use of this neat new feature

This is great; I'm really surprised that I've not heard of it before. As its use in the wild may not be immediately obvious to an editor encountering it, should we make it good practice to accompany it with a comment, something along the lines of <!-- See Help:LST -->? — Scott talk 16:49, 14 February 2014 (UTC)[reply]

@Gadget850: Actually, come to think of it - rather than using the &lt;section&gt; tag directly, it would be better to use templates generating the tag - say, {{section begin}} and {{section end}}. That way, anyone encountering them in the code would be able to go immediately to the template for documentation. It's hard to find a help page for a raw tag. What do you think? — Scott talk 00:38, 15 February 2014 (UTC)[reply]
Because parser tags must use #tag to include variables and #tag does not work with <section>. See the Templates section and {{section}}. --  Gadget850 talk 01:18, 15 February 2014 (UTC)[reply]
How annoying. I've subscribed to Template:Bug - thanks. — Scott talk 22:46, 15 February 2014 (UTC)[reply]
@Scott: Good idea. I just encountered Template:Latest tech news "in the wild" and did just that. Now, I see your comment here confirming the rationale for my edit. My initial guess was that #lst: meant "last section", so I changed that to #section: as well. Regards, Wbm1058 (talk) 11:35, 24 July 2014 (UTC)[reply]

Is labeled section transclusion useful only when there are more than one labeled sections to transclude?

mw:Extension:Labeled Section Transclusion says: "Its functionality is similar to an enhanced version of the <onlyinclude> tag with normal wiki transclusion, which selects sections for inclusion." It seems to me that <onlyinclude> is incompatible with labeled section transclusion, i.e., if you use one, you can't use the other. If there is only one section to be "onlyincluded", then using <onlyinclude> tags is sufficient for the purpose, and there is no benefit to converting those to a single labeled section. Only if one wants to have multiple labeled sections on the same page, does using labeled section transclusion become worthwhile. Is that correct? Wbm1058 (talk) 12:25, 24 July 2014 (UTC)[reply]

Sounds about right. Never tested the interaction between <onlyinclude> and <section> but I would not recommend mixing them. --  Gadget850 talk 14:43, 24 July 2014 (UTC)[reply]