Template:ExcerptHeaderLevel
| This template uses Lua: |
Transcludes a section from another page and adjusts heading levels in the excerpt.
Parameters
[edit]- 1 or page – source page
- 2 or section – exact section heading to transclude
- top-header-level – absolute level for the inserted top heading
- child headings are adjusted automatically relative to it
- if set, shift, higher, and lower are ignored
- shift / higher / lower – relative heading adjustment when top-header-level is not set
- include-top-header – whether to include the transcluded section heading
- default:
yes
- default:
Examples
[edit]See it in action at Operation Salvo#Protests.
Basic transclusion
[edit]{{ExcerptHeaderLevel|Example article|History}}
Transcludes the section with its default heading behavior.
Absolute top heading level
[edit]{{ExcerptHeaderLevel|Example article|History|top-header-level=2}}
Sets the inserted section heading to level 2 and adjusts child headings relative to it.
Omit the transcluded section heading
[edit]{{ExcerptHeaderLevel|Example article|History|include-top-header=no}}
Transcludes only the section contents, without the section heading itself.
Lower all headings by 1
[edit]{{ExcerptHeaderLevel|Example article|History|lower=1}}
Useful when the excerpt needs to sit one level deeper in the destination page.
Raise all headings by 1
[edit]{{ExcerptHeaderLevel|Example article|History|higher=1}}
Useful when the excerpted headings are too deep relative to the destination page.
Signed shift
[edit]{{ExcerptHeaderLevel|Example article|History|shift=1}}
Equivalent to:
{{ExcerptHeaderLevel|Example article|History|lower=1}}
And:
{{ExcerptHeaderLevel|Example article|History|shift=-1}}
Equivalent to:
{{ExcerptHeaderLevel|Example article|History|higher=1}}
Include top header at a fixed level
[edit]{{ExcerptHeaderLevel
|Government attacks on journalists during the Trump presidencies
|2016–2017: Transition between Barack Obama and Donald Trump's presidencies
|top-header-level=2
|include-top-header=yes
}}
Useful when the destination page needs the transcluded section heading at a specific level, with all child headings following automatically.
Relative shifting without top-header-level
[edit]{{ExcerptHeaderLevel
|Government attacks on journalists during the Trump presidencies
|2016–2017: Transition between Barack Obama and Donald Trump's presidencies
|lower=1
|include-top-header=yes
}}
Useful when you just want to shift the excerpted heading structure down by one level without setting an absolute top heading level.
See also
[edit]- {{Excerpt}}
- {{Transclude lead excerpt}}
TemplateData
[edit]TemplateData for ExcerptHeaderLevel
Transcludes a section from another page and adjusts heading levels, with optional inclusion of the transcluded section heading.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Page | 1 | Source page name | Page name | required |
| Section | 2 | Exact section heading to transclude | String | required |
| Page | page | Source page name | Page name | optional |
| Section | section | Exact section heading to transclude | String | optional |
| Top header level | top-header-level | Absolute level for the inserted top heading. Child headings are adjusted automatically relative to it. | Number | optional |
| Shift | shift | Relative heading offset. Ignored if top-header-level is set. | Number | optional |
| Raise headings | higher | Raise headings by this many levels. Ignored if top-header-level is set. | Number | optional |
| Lower headings | lower | Lower headings by this many levels. Ignored if top-header-level is set. | Number | optional |
| Include top header | include-top-header | Whether to include the transcluded section heading.
| String | optional |
| This template has not been added to any categories. Please help out by adding categories to it so that it can be listed with similar templates. |