Help:Section/Editing sections of included templates
Editing sections of included templates
This section appears in Help:Section.
The editing facilities can also be applied to a section of an included template. This section, Help:Editing sections of included templates, is an example.
For the purpose of section editing the extent of a section is governed by the headers in the calling page itself. It may consist of a part before the template tag, the template tag, and a part after the template tag, even if the template has sections.
It tends to be confusing if the extent of sections according to the system is different from what the rendered page suggests. To avoid this:
- if a template has headers, do not put any text before the first header
- in the calling page, start a new section after a template that itself has sections
It may be convenient, where suitable, to start a template with a section header, even if normally the contents of the template would not need a division into sections, and thus the template is only one section. The edit facilities for editing sections can then be used for editing the template from a page that includes it, without specially putting an edit link. This template is an example, it does not need a division into sections, but has a header at the top.
One downside with this solution is that you can't change the section level in the page that includes the template. This means that the section level you use in the template will be the same that is displayed on all your pages where you include the template, despite the fact that this might conflict with your intended hierarchy on the different pages.
Note that a parameter value appearing in a template, for example "{{{1}}}", is, if we want to preserve the parameter, not edited by editing the template but by editing the template call, even though the rendered page and its edit links do not automatically show that. Some explanatory text and/or an extra edit link can be useful. In this case, to edit "{{{1}}}" we have to edit the template tag on the page calling the template. If we use section editing the relevant section edit link is that at the header appearing before the header in the template itself.
The __NOEDITSECTION__ tag in any template affects both that template, the pages it's included on, and any other templates included on the same page.
{{fake heading}} can be used in templates and help pages where the appearance of a heading is desired without showing in the table of contents and without an edit link.