Main page
New page
Upload file
Help
Community portal
Recent changes
Talk
Contributions
Create account
Enable dark mode
Enable read mode
Log in
View history
What links here
Related changes
Page information
Editing
Template:Excerpt/doc
From Appropedia
Are you familiar with
Appropedia's template guidelines
?
Warning!
You are not logged in.
Log in
or
create an account
to have your edits attributed to your username rather than your IP, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Documentation subpage}} Use this template to reuse parts of pages in other pages. This practice has several advantages: * '''Reduces maintenance''' by avoiding duplicate content that must be updated multiple times * '''Improves content quality''' by encouraging editors to merge related content, rather than having multiple versions in various stages of development * '''Fosters collaboration''' by channeling contributors into one place, rather than working in parallel This template extends the capabilities of the built-in [[Special:MyLanguage/Transclusion|normal transclusion]]. == Usage == === Basic usage === * <code><nowiki>{{Excerpt|Page title}}</nowiki></code> β Transclude the lead section. * <code><nowiki>{{Excerpt|Page title|Section title}}</nowiki></code> β Transclude a specific section, excluding any subsections. === Parameters === * <code>1</code> β Title of the page to transclude. '''Only required parameter.''' By default the lead section will be transcluded. * <code>2</code> β Title of the section to transclude. * <code>fragment</code> β Name of the fragment to transclude. Must be marked with <code><nowiki><section begin=Name of the fragment/></nowiki></code> and <code><nowiki><section end=Name of the fragment/></nowiki></code> in the transcluded page. Notice that this template provides other ways of targeting specific fragments of a page without having to resort to section tags. * <code>only</code> β Elements to transclude. By default all elements are transcluded. ** <code>only=file</code> or <code>only=files</code> β Transclude only files ** <code>only=list</code> or <code>only=lists</code> β Transclude only lists ** <code>only=table</code> or <code>only=tables</code> β Transclude only tables ** <code>only=template</code> or <code>only=templates</code> β Transclude only templates ** <code>only=paragraph</code> or <code>only=paragraphs</code> β Transclude only paragraphs * <code>paragraphs</code> β Paragraphs to transclude. By default all paragraphs are transcluded. ** <code>paragraphs=0</code> β Transclude no paragraphs ** <code>paragraphs=1</code> β Transclude the first paragraph ** <code>paragraphs=2</code> β Transclude the second paragraph ** <code>paragraphs=1,3</code> β Transclude the first and third paragraphs ** <code>paragraphs=1-3</code> β Transclude the first, second and third paragraphs ** <code>paragraphs=1-3,5</code> β Transclude the first, second, third and fifth paragraphs ** <code>paragraphs=-1</code> β Transclude all paragraphs except the first ** <code>paragraphs=-2</code> β Transclude all paragraphs except the second ** <code>paragraphs=-1,3</code> β Transclude all paragraphs except the first and third ** <code>paragraphs=-1-3</code> β Transclude all paragraphs except the first, second and third ** <code>paragraphs=-1-3,5</code> β Transclude all paragraphs except the first, second, third and fifth * <code>lists</code> β Lists to transclude. By default all lists are transcluded. Same syntax as when transcluding paragraphs. * <code>files</code> β Files to transclude. By default all files are transcluded. Same syntax as when transcluding paragraphs, but also: ** <code>files=A.jpg</code> β Transclude the file named 'A.jpg' ** <code>files=A.jpg, B.png, C.gif</code> β Transclude the files named 'A.jpg', 'B.png' and 'C.gif' ** <code>files=.+%.png</code> β Transclude all PNG files ** <code>files=-A.jpg</code> β Transclude all files except the one named 'A.jpg' ** <code>files=-A.jpg, B.png, C.gif</code> β Transclude all files except the ones named 'A.jpg', 'B.png' and 'C.gif' ** <code>files=-.+%.png</code> β Transclude all non-PNG files * <code>tables</code> β Tables to transclude. By default all tables are transcluded. Same syntax as when transcluding paragraphs, but also: ** <code>tables=Stats2020</code> β Transclude the table with id 'Stats2020' ** <code>tables=Stats2020, Stats2019, Stats2018</code> β Transclude the tables with ids 'Stats2020', 'Stats2019' and 'Stats2018' ** <code>tables=-Stats2020</code> β Transclude all tables except the one with id 'Stats2020' ** <code>tables=-Stats2020, Stats2019, Stats2018</code> β Transclude all tables except the ones with ids 'Stats2020', 'Stats2019' and 'Stats2018' * <code>templates</code> β Templates to transclude. By default all templates are transcluded. Same syntax as when transcluding paragraphs, but also: ** <code>templates=Infobox</code> β Transclude the template 'Infobox' ** <code>templates=Infobox, Navbox, Chart</code> β Transclude the template 'Infobox', 'Navbox' and 'Chart' ** <code>templates=-Infobox</code> β Transclude all templates except 'Infobox' ** <code>templates=-Infobox, Navbox, Chart</code> β Transclude all templates except 'Infobox', 'Navbox' and 'Chart' * <code>this</code> β Change the initial text of the hatnote. For example, if the transcluded content is a gallery, you can set <code>this=This gallery is</code> so that the hatnote reads "This gallery is an excerpt from..." * <code>card=no</code> β Don't wrap the excerpt with [[Template:Card]] * <code>bold=yes</code> β Keep bold text. * <code>quote=yes</code> β Wrap the excerpt with <code><nowiki><blockquote></nowiki></code> tags. * <code>inline=yes</code> β Remove the hatnote and the <code><nowiki><div></nowiki></code> tags around the excerpt, to use it inside other text. * <code>references=no</code> β Remove all references. * <code>subsections=yes</code> β Include subsections of the transcluded section. Notice that if the transclusion is done from a section level 3, and the transcluded subsections are level 3 too, then the transcluded subsections will show with the same hierarchy as the transcluding section, which is probably not desirable, so use with caution. === Replacing sections for excerpts === [[File:How to excerpt.webm|thumb|How to replace a section for an excerpt.]] Sections are often summaries of more precise subpages. Sometimes it's convenient to replace the content of such sections for excerpts of the subpages, after merging the original content of the section (if any) into the subpage. This improves both the subpage and the section, reduces maintenance, drives contributors to collaborate, etc. An efficient way to proceed is: # Open the section in one tab and the subpage in another. # Edit both. # Copy the text of the section and paste it below the lead section of the subpage. # Delete repeated content and adjust using common sense. # Save the changes in the subpage with an edit summary like: Bring content from <nowiki>[[Page]]</nowiki>. # Back to the section, delete all content and replace it for an excerpt of the subpage. # Save the changes in the section with an edit summary like: Move content to <nowiki>[[Subpage]]</nowiki> and leave an excerpt. === Excerpt trees === [[File:Excerpt tree.png|thumb|Visual representation of an 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". In this section you can navigate the main excerpt trees on Appropedia. It's useful for editors interested in expanding or improving them. {{ExcerptTree| * [[Composting toilet]] * [[Nuclear energy]] * [[Rainwater harvesting]] * [[Bamboo]] * [[Solar energy]] * [[Lighting]] * [[Conventional farming]] * [[Redwood Coast Energy Authority]] }} == See also == * [[Module:Excerpt]] * [[Module:Excerpt/config]] * [[Module:Transcluder]] * [[Template:Wikipedia excerpt]] == Template data == <templatedata> { "params": { "1": { "aliases": [ "article", "page" ], "label": "Article", "description": "Name of the article or page to transclude", "example": "Science", "type": "wiki-page-name", "required": true }, "2": { "aliases": [ "section", "fragment" ], "label": "Section", "description": "Name of the section or <section> tag to transclude", "example": "History", "type": "string" }, "paragraphs": { "label": "Paragraphs", "description": "Paragraphs to transclude", "example": "1-3,5", "type": "string", "aliases": [ "paragraph" ] }, "files": { "label": "Files", "description": "Files to transclude", "example": "1-3,5", "type": "string", "default": "1", "aliases": [ "file" ] }, "subsections": { "label": "Subsections", "description": "Whether to transclude the subsections of the requested section", "example": "yes", "type": "boolean" }, "tables": { "label": "Tables", "description": "Tables to transclude", "example": "Stats2020", "type": "string", "aliases": [ "table" ] }, "references": { "label": "References", "description": "Whether to transclude the references", "example": "no", "type": "boolean" }, "only": { "label": "Only", "description": "Transclude only this kind of element", "example": "table", "type": "string" }, "this": { "label": "This", "description": "Change the initial text of the hatnote", "example": "This gallery is", "type": "string" }, "class": { "label": "Class", "description": "Additional CSS class", "example": "noprint", "type": "string" }, "hat": { "label": "Hatnote", "description": "Whether to include the hatnote", "example": "no", "type": "boolean" }, "inline": { "label": "Inline", "description": "Remove the hatnote and wrap the excerpt with <span> tags to use it inside other text", "example": "yes", "type": "boolean" }, "lists": { "aliases": [ "list" ], "label": "Lists", "description": "Lists to transclude", "example": "1", "type": "string" }, "templates": { "aliases": [ "template" ], "label": "Templates", "description": "Templates to transclude", "example": "Infobox person", "type": "string" }, "more": { "label": "More", "description": "Whether to include the \"Read more\" button", "example": "no", "type": "boolean", "default": "yes" } }, "description": "Use this template to reuse parts of pages in other pages.", "paramOrder": [ "1", "2", "only", "paragraphs", "files", "tables", "lists", "templates", "references", "subsections", "hat", "this", "more", "inline", "class" ] } </templatedata> <includeonly> [[Category:Element templates]] </includeonly>
Summary:
Warning!
All contributions to Appropedia are released under the CC-BY-SA-4.0 license unless otherwise noted (see
Appropedia:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here! You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted material without permission!
Cancel
Editing help
(opens in new window)
Preview page with this template
Templates used on this page:
MediaWiki:TemplateExcerptTree.js
(
view source
)
MediaWiki:TemplateNotice.js
(
view source
)
Template:Documentation subpage
(
edit
)
Template:ExcerptTree
(
edit
)
Template:Notice
(
view source
) (protected)
Template:Notice/styles.css
(
edit
)
Cookies help us deliver our services. By using our services, you agree to our use of cookies.
OK
Discussion