Template:ExcerptHeaderLevel/doc

Transcludes a section from another page and adjusts heading levels in the excerpt.

Parameters

  • 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

Examples

See it in action at Operation Salvo#Protests.

Basic transclusion

{{ExcerptHeaderLevel|Example article|History}}

Transcludes the section with its default heading behavior.

Absolute top heading level

{{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

{{ExcerptHeaderLevel|Example article|History|include-top-header=no}}

Transcludes only the section contents, without the section heading itself.

Lower all headings by 1

{{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

{{ExcerptHeaderLevel|Example article|History|higher=1}}

Useful when the excerpted headings are too deep relative to the destination page.

Signed shift

{{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

{{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

{{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

TemplateData

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:ExcerptHeaderLevel in articles based on its TemplateData.

TemplateData for ExcerptHeaderLevel

Transcludes a section from another page and adjusts heading levels, with optional inclusion of the transcluded section heading.

Template parameters

ParameterDescriptionTypeStatus
Page1

Source page name

Page namerequired
Section2

Exact section heading to transclude

Stringrequired
Pagepage

Source page name

Page nameoptional
Sectionsection

Exact section heading to transclude

Stringoptional
Top header leveltop-header-level

Absolute level for the inserted top heading. Child headings are adjusted automatically relative to it.

Numberoptional
Shiftshift

Relative heading offset. Ignored if top-header-level is set.

Numberoptional
Raise headingshigher

Raise headings by this many levels. Ignored if top-header-level is set.

Numberoptional
Lower headingslower

Lower headings by this many levels. Ignored if top-header-level is set.

Numberoptional
Include top headerinclude-top-header

Whether to include the transcluded section heading.

Suggested values
yes no
Stringoptional


Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.