Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Usage  





2 Parameters  



2.1  Summary  





2.2  Details  







3 Tips and how-to  



3.1  Compared to #section  





3.2  Differing citation styles  





3.3  Excerpt trees  





3.4  Refinement using inclusion control  





3.5  Replacing summary section with excerpt of child article  





3.6  Suppress line breaks between paragraphs  







4 Advantages and disadvantages  





5 Incompatibilities  





6 Error messages  





7 See also  





8 Template data  














Template:Excerpt






العربية
Avañe'
Basa Bali

Беларуская (тарашкевіца)
Català
Deutsch
Español
فارسی
Français
Galego

Bahasa Indonesia
Македонски


Bahasa Melayu


Oʻzbekcha / ўзбекча
Português
Русский
Shqip

Simple English
Slovenščina
ி
 

Türkçe
Українська
اردو
Tiếng Vit


 

Edit links
 









Template
Talk
 

















Read
View source
View history
 








Tools
   


Actions  



Read
View source
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 




In other projects  



MediaWiki
 
















Appearance
   

 





Permanently protected template

From Wikipedia, the free encyclopedia
 


This template is used for reusing parts of pages in other pages. This practice has various advantages and disadvantages.

This template extends the capabilities of the built-in normal transclusion and labeled section transclusion.

Usage

Parameters

There is one required parameter, and numerous optional ones for configuring the excerpt:

Summary

Source identification

Transclusion config

Transcludable content is defined as one of several element types: file, list, paragraph, reference, subsection, table, or template. Config parameters specify which element type to transclude, and in some cases, how many and which items of that type to transclude. All config parameters are optional; if omitted, all items of all element types are transcluded from the source page identified by the two unnamed parameters. Some element types support conditional item transclusion by specifying an item number range (1-3) or comma series (1, 2, 5); these types include: files, lists, paragraphs, and tables.

There are ten optional transclusion configuration parameters:

Style and extra features

These optional parameters alter the way transcluded items are displayed:

Details

Tips and how-to

Compared to #section

For simple cases of transcluding sections of articles, the {{#section}}, {{#section-x}}, and {{#section-h}} (abbreviated {{#lst}}, {{#lstx}}, and {{#lsth}})) parser functions can be used instead of this template. {{#lsth:article|fragmentname}} will transclude the section of "article" with the header "fragmentname", and {{#lsth:article}} will transclude the lead section of "article". Excerpting only specific paragraphs can be done by marking up the source article with <section begin=fragmentname/>...<section end=fragmentname/> tags and using {{#lst:article|fragmentname}} to transclude those fragments, which is equivalent to using the |fragment=fragmentname parameter with this template. {{#lsth:article|fragmentname}} can also be used to transclude everything but those fragments.

The text will not be trimmed of excess whitespace, there will not be a header (equivalent to |hat=no, and all files, templates, tables, references, and subsections will be included unless the source article is marked up with <section begin=fragmentname/>...<section end=fragmentname/>, <noinclude>...</noinclude>, or <onlyinclude>...</onlyinclude> tags. Self links will appear in bold.

Differing citation styles

It can happen that the source you want to excerpt contains footnotes in a different citation style than your article, and excerpting the source would cause a citation style mismatch, which is contrary to the guideline on citing sources. Sometimes, excerpt can still be used, while avoiding a mismatch in style, by the use of params |references=no and |inline=yes.

If the source you want to excerpt has multiple ref-tags interspersed throughout the source, and they need to display exactly in those locations in order to maintain full verifiability, then this source might not be a good candidate for transclusion via the {{excerpt}} template, and copying the content from the source into the article might be a better choice.

However, if the source page you want to excerpt has either:

then you can do it. To implement this, use params |references=no to strip the ref-tags from the transcluded content, and |inline=yes to define the excerpt as an inline display element in order to § Suppress line breaks between paragraphs, and then manually append a copy of all the references in the source immediately after the excerpt tag ending curly braces in the target article, with no intervening line breaks, white space, or other characters between the tag and the appended references. The copied references will have to be manually converted from short footnote-style to full, inline citation-style, or vice-versa, to match the citation style of the target.

Excerpt trees

Visual representation of an imaginary excerpt tree.

When a very general article uses excerpts from more specific articles, which in turn use excerpts from even more specific articles, then a tree structure emerges, called an "Excerpt tree".

Here you can navigate the main excerpt trees on the English Wikipedia. It's useful for editors interested in expanding or improving them. To navigate the trees, click the following button(S):

See the excerpt trees

  • Algae
  • Africa
  • Aquatic ecosystem
  • Bangladesh
  • Campanology
  • Climate change in Africa
  • Climate change in South Asia
  • Climate justice
  • COVID-19 pandemic
  • Ecosystem
  • Effects of climate change on humans
  • Environmental impact of agriculture
  • Eutrophication
  • Fishing industry
  • Food
  • God
  • Hygiene
  • List of carillons
  • List of LGBT-related cases in the United States Supreme Court
  • Marine debris
  • Middle East
  • Ocean
  • Plastic pollution
  • Public health
  • Sanitation
  • Sewage
  • Sustainable Development Goals
  • Tourism
  • Wastewater treatment
  • Water resources
  • Refinement using inclusion control

    Sometimes, a passage will almost fit for a transclusion, but not quite. In these cases, you can edit the source page to add <noinclude>...</noinclude> tags around content you don't want in the excerpt and <includeonly>...</includeonly> tags around content you want only in the excerpt.

    For instance, the page COVID-19 misinformation begins with "The COVID-19 pandemic has resulted in misinformation...". However, when excerpting this lead to the misinformation section of COVID-19 pandemic, we don't need to specify which pandemic we're referring to. Therefore, the code The <noinclude>[[COVID-19 pandemic]]</noinclude><includeonly>pandemic</includeonly> has resulted in [[misinformation]] can be used at the misinformation page, so that it will appear at the pandemic page as "The pandemic has resulted in misinformation...".

    For pages with a high volume of edits, it may be a good idea to leave a hidden comment explaining why the tags are there, so that no one will be tempted to remove them, like so: The <noinclude>[[COVID-19 pandemic]]</noinclude><!--These tags are used to refine the excerpt at [[COVID-19 pandemic]]--><includeonly>pandemic</includeonly> has resulted in [[misinformation]]

    Please note that when the </noinclude> tag is wrapped into a new line, a character next to it would be interpreted as a line beginning. This can lead to some formatting problems. For example, when a </noinclude> at line beginning is succeeded by a whitespace character, the page engine would translate this as a leading space that renders the subsequent paragraph in code block and monospaced font with preserved formatting. For this reason, no spaces should separate the </noinclude> tag from the text it precedes.

    Replacing summary section with excerpt of child article

    How to replace a section with an excerpt.

    A section is often a summary in a parent article of a more detailed page about a subtopic located in a child page; these are generally linked with Template:Main in the parent. Sometimes it's convenient to replace the content of such a summary section in the parent with an excerpt of the child page lead (after merging any valuable content of the section into the child page). In such cases, an efficient way to proceed is:

    1. Open the parent section for editing in one tab, and the child article in another.
    2. Copy the text of the parent section and append it to the lead section of the child page.
    3. Consolidate and adjust the combined lead using common sense.
    4. Save the changes in the child article with an edit summary like: "Copied content from [[Page]]. See that article's history for attribution."
    5. Back in the parent page section, delete all content except the section header and replace it with an excerpt of the child page.
    6. Save the changes in the section; proposed edit summary: "Moved section content to [[Child page title]] and replaced with excerpt."

    Suppress line breaks between paragraphs

    If you want to merge two excerpted paragraphs from a source into one longer one in your article, use two excerpts instead of one, and change the display mode to inline. So, for example, instead of this :

    {{excerpt|Ocean color|paragraphs=2-3|file=no}} // (example taken from Ocean#Color)

    you could code:

    {{excerpt|Ocean color|paragraphs=2|file=no|inline=yes}}
    {{excerpt|Ocean color|paragraphs=3|file=no|inline=yes}}

    and this will remove the line break between the two paragraphs, so they will render as one paragraph.

    By default, an {{excerpt}} generates an HTML div-tag, which is a block-level display element, so contiguous excerpts are normally separate block elements with line breaks between them. This can be overridden through use of param |inline=yes, which suppresses the div-tag, and results in an inline display element instead. In this case, just as with running text on adjacent lines of wikicode, no line break is generated between them. This technique can also be adapted to § change citation style or use different references.

    Advantages and disadvantages

    The use of {{Excerpt}} has the following advantages:

    It also has the following disadvantages:

    Incompatibilities

    Issues in template {{R}} make it incompatible with the {{excerpt}} template. {{r}} should not be used in sections that will be transcluded by {{excerpt}}.

    Error messages

    If an error is detected, an error message will appear in the article in place of the expected transcluded content:

    See also

    Template data

    This template is used for transcluding part of an article into another article.

    Template parameters[Edit template data]

    ParameterDescriptionTypeStatus
    Article1 article page

    Name of the article or page to transclude

    Example
    Science
    Page namerequired
    Section2 section fragment

    Name of the section or <section> tag to transclude

    Example
    History
    Stringoptional
    Onlyonly

    Transclude only this kind of element

    Example
    table
    Stringoptional
    Paragraphsparagraphs paragraph

    Paragraphs to transclude

    Example
    1-3,5
    Stringoptional
    Filesfiles file

    Files to transclude

    Default
    1
    Example
    1-3,5
    Stringoptional
    Tablestables table

    Tables to transclude

    Example
    Stats2020
    Stringoptional
    Listslists list

    Lists to transclude

    Example
    1
    Stringoptional
    Templatestemplates template

    Templates to transclude

    Example
    Infobox person
    Stringoptional
    Referencesreferences

    Whether to transclude the references

    Example
    no
    Booleanoptional
    Subsectionssubsections

    Whether to transclude the subsections of the requested section

    Example
    yes
    Booleanoptional
    Hatnotehat

    Whether to include the hatnote

    Default
    yes
    Example
    no
    Booleanoptional
    Boldbold

    Whether to preserve bold text

    Default
    yes
    Example
    no
    Booleanoptional
    Wikilinkslinks

    Whether to preserve wikilinks

    Default
    yes
    Example
    no
    Booleanoptional
    Quotequote

    Wraps the excerpt in <blockquote> tags

    Default
    no
    Example
    yes
    Booleanoptional
    Thisthis

    Change the initial text of the hatnote

    Example
    This gallery is
    Stringoptional
    Display titledisplaytitle

    Change the text of the link in the hatnote

    Stringoptional
    Inlineinline

    Remove the hatnote and <div> tags around the excerpt, to use it inside other text

    Default
    no
    Example
    yes
    Booleanoptional
    Only free filesonlyfreefiles

    Enable transclusion of non-free files

    Default
    no
    Example
    yes
    Booleanoptional
    Brief datesbriefdates

    Abbreviate birth and death information to (YYYY-YYYY) format

    Default
    no
    Example
    yes
    Booleanoptional
    Classclass

    Additional CSS class

    Example
    noprint
    Stringoptional

    Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Excerpt&oldid=1097065471"

    Categories: 
    Lua-based templates
    Wikipedia page-section templates
    Hidden category: 
    Wikipedia template-protected templates
     



    This page was last edited on 8 July 2022, at 12:04 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki