Issue:Labeling Sections from Templates

From FollowTheScore
Revision as of 22:16, 25 March 2008 by Evan Sultanik (talk | contribs) (New page: {{Issue |Type = Bug |Extension = DPL |Version = 1.6.8 |Description = Section labeling doesn't seem to work from within templates. |Status = open }} == Problem == M...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Description: Section labeling doesn't seem to work from within templates.
Extension / Version: DPL   /   1.6.8
Type / Status: Bug   /   open

Problem

My problem is related to labeling sections for future labeled section transclusion. Let's say I have the following page:

<section begin=foo />

Some text.

<section end=foo />

Instead of having the raw section tags, though, I want to have two templates:

Template:BeginFoo

<section begin=foo />

Template:EndFoo

<section end=foo />

such that I can do the following:

{{BeginFoo}}

Some text.

{{EndFoo}}

The problem is, this doesn't seem to work! Looking at the DPL code, I'm guessing this is because the section tag is rendered to an empty string, so when the BeginFoo template is transcluded, the section tag is rendered and not actually present in the calling page.

Workaround

The only workaround I can think of is to call

{{subst:BeginFoo}}

Some text.

{{subst:EndFoo}}

but that is less than desirable.

--Evan Sultanik 21:16, 25 March 2008 (CET)

Reply