Template:Excerpt: Difference between revisions
mediawiki>Shirayuki Marked this version for translation |
m 1 revision imported |
||
(No difference)
|
Latest revision as of 02:12, 16 September 2024
<languages />
This template uses Lua: |
<translate> This template is used for reusing parts of pages in other pages.</translate> <translate> This practice has several advantages:</translate>
<translate>
- Reduces maintenance by avoiding duplicate content that must be updated multiple times</translate>
<translate>
- Improves content quality by encouraging editors to merge related content, rather than having multiple versions in various stages of development</translate>
<translate>
- Fosters collaboration by channeling contributors into one place, rather than working in parallel
This template extends the capabilities of the built-in [[<tvar name=1>Special:MyLanguage/Transclusion</tvar>|normal transclusion]].
Usage
Basic usage
</translate>
{{Excerpt|Page title}}
— <translate> Transclude the lead section ([[<tvar name=1>#Lead section</tvar>|example]])</translate>{{Excerpt|Page title|Section title}}
— <translate> Transclude a specific section, excluding any subsections ([[<tvar name=1>#Specific section</tvar>|example]])</translate>
<translate>
Parameters
</translate>
1
— <translate> Title of the page to transclude.</translate> <translate> Only required parameter.</translate> <translate> By default the lead section will be transcluded ([[<tvar name=1>#Lead section</tvar>|example]]).</translate>2
— <translate> Title of the section to transclude ([[<tvar name=1>#Specific section</tvar>|example]]) or name of the [[<tvar name=2>Special:MyLanguage/Extension:Labeled Section Transclusion#How it works</tvar>|<tvar name=3><section>
</tvar> tag]] to transclude.</translate> <translate> Notice that this template provides other ways of targeting specific elements of a page without having to resort to section tags.</translate>only
— <translate> Elements to transclude ([[<tvar name=1>#Files only</tvar>|example]]).</translate> <translate> By default all elements are transcluded.</translate>only=file
<translate> or</translate>only=files
— <translate> Transclude only files</translate>only=list
<translate> or</translate>only=lists
— <translate> Transclude only lists</translate>only=table
<translate> or</translate>only=tables
— <translate> Transclude only tables</translate>only=template
<translate> or</translate>only=templates
— <translate> Transclude only templates</translate>only=paragraph
<translate> or</translate>only=paragraphs
— <translate> Transclude only paragraphs</translate>
paragraphs
— <translate> Paragraphs to transclude.</translate> <translate> By default all paragraphs are transcluded.</translate>paragraphs=0
— <translate> Transclude no paragraphs</translate>paragraphs=1
— <translate> Transclude the first paragraph</translate>paragraphs=2
— <translate> Transclude the second paragraph</translate>paragraphs=1,3
— <translate> Transclude the first and third paragraphs</translate>paragraphs=1-3
— <translate> Transclude the first, second and third paragraphs</translate>paragraphs=1-3,5
— <translate> Transclude the first, second, third and fifth paragraphs</translate>paragraphs=-1
— <translate> Transclude all paragraphs except the first</translate>paragraphs=-2
— <translate> Transclude all paragraphs except the second</translate>paragraphs=-1,3
— <translate> Transclude all paragraphs except the first and third</translate>paragraphs=-1-3
— <translate> Transclude all paragraphs except the first, second and third</translate>paragraphs=-1-3,5
— <translate> Transclude all paragraphs except the first, second, third and fifth</translate>
lists
— <translate> Lists to transclude.</translate> <translate> By default all lists are transcluded.</translate> <translate> Same syntax as when transcluding paragraphs.</translate>files
— <translate> Files to transclude.</translate> <translate> By default all files are transcluded.</translate> <translate> Same syntax as when transcluding paragraphs, but also:</translate>files=A.jpg
— <translate> Transclude the file named '<tvar name=1>A.jpg</tvar>'</translate>files=A.jpg, B.png, C.gif
— <translate> Transclude the files named '<tvar name=1>A.jpg</tvar>', '<tvar name=2>B.png</tvar>' and '<tvar name=3>C.gif</tvar>'</translate>files=.+%.png
— <translate> Transclude all PNG files</translate>files=-A.jpg
— <translate> Transclude all files except the one named '<tvar name=1>A.jpg</tvar>'</translate>files=-A.jpg, B.png, C.gif
— <translate> Transclude all files except the ones named '<tvar name=1>A.jpg</tvar>', '<tvar name=2>B.png</tvar>' and '<tvar name=3>C.gif</tvar>'</translate>files=-.+%.png
— <translate> Transclude all non-PNG files</translate>
tables
— <translate> Tables to transclude.</translate> <translate> By default all tables are transcluded.</translate> <translate> Same syntax as when transcluding paragraphs, but also:</translate>tables=Stats2020
— <translate> Transclude the table with id '<tvar name=1>Stats2020</tvar>'</translate>tables=Stats2020, Stats2019, Stats2018
— <translate> Transclude the tables with ids '<tvar name=1>Stats2020</tvar>', '<tvar name=2>Stats2019</tvar>' and '<tvar name=3>Stats2018</tvar>'</translate>tables=-Stats2020
— <translate> Transclude all tables except the one with id '<tvar name=1>Stats2020</tvar>'</translate>tables=-Stats2020, Stats2019, Stats2018
— <translate> Transclude all tables except the ones with ids '<tvar name=1>Stats2020</tvar>', '<tvar name=2>Stats2019</tvar>' and '<tvar name=3>Stats2018</tvar>'</translate>
templates
— <translate> Templates to transclude.</translate> <translate> By default all templates are transcluded.</translate> <translate> Same syntax as when transcluding paragraphs, but also:</translate>templates=Infobox
— <translate> Transclude the template '<tvar name=1>Infobox</tvar>'</translate>templates=Infobox, Navbox, Chart
— <translate> Transclude the template '<tvar name=1>Infobox</tvar>', '<tvar name=2>Navbox</tvar>' and '<tvar name=3>Chart</tvar>'</translate>templates=-Infobox
— <translate> Transclude all templates except '<tvar name=1>Infobox</tvar>'</translate>templates=-Infobox, Navbox, Chart
— <translate> Transclude all templates except '<tvar name=1>Infobox</tvar>', '<tvar name=2>Navbox</tvar>' and '<tvar name=3>Chart</tvar>'</translate>
this
— <translate> Change the initial text of the hatnote. For example, if the transcluded content is a gallery, you can set <tvar name=1>this=This gallery is
</tvar> so that the hatnote reads "This gallery is an excerpt from..."</translate>displaytitle
— <translate> Change the text of the link in the hatnote. For example to add italics, subscripts, etc.</translate>hat=no
— <translate> Hide the hatnote "This section is an excerpt from..."</translate>more=yes
— <translate> Show a "Read more..." link at the end</translate>bold=yes
— <translate> Keep bold text.</translate>quote=yes
— <translate> Wrap the excerpt with <tvar name=1><blockquote>
</tvar> tags.</translate>inline=yes
— <translate> Remove the hatnote and <tvar name=1><div>
</tvar> tags around the excerpt, to use it inside other text.</translate>references=no
— <translate> Remove all references.</translate>subsections=yes
— <translate> 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.</translate>
<translate>
Replacing a section with an excerpt
</translate> File:How to excerpt.webm
<translate> A section is often a summary of a more precise page dealing with a subtopic.</translate> <translate> Sometimes it's convenient to replace the content of such a section with an excerpt of the page about the subtopic, after merging the original content of the section (if any) into the page about the subtopic.</translate> <translate> This improves both the page about the subtopic and the section, reduces maintenance, drives contributors to collaborate, etc.</translate>
<translate> An efficient way to proceed is:</translate>
<translate>
- Open the section for editing in one tab, and the page about the subtopic in another.</translate>
<translate>
- Copy the text of the section and append it to the lead of the page about the subtopic.</translate>
<translate>
- Consolidate and adjust the combined lead using common sense.</translate>
<translate>
- Save the changes in the child article with an edit summary like: Copied content from <tvar name=1>[[Page]]</tvar>; see that article's history for attribution.</translate>
<translate>
- Back in the section, delete all content and replace it with an excerpt of the page about the subtopic.</translate>
<translate>
- Save the changes in the section with an edit summary like: Move content to <tvar name=1>[[page about the subtopic]]</tvar> and leave an excerpt.
Excerpt trees
</translate>
<translate> 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". </translate>
<translate> Below you can navigate the main excerpt trees on this wiki.</translate> <translate> It's useful for editors interested in expanding or improving them.</translate>
<syntaxhighlight lang="php"></syntaxhighlight><translate>
Examples
Lead section
</translate>
{{Excerpt|Lorem ipsum}}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.[1]
<translate>
Specific section
</translate>
{{Excerpt|Lorem ipsum|Section}}
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?
<translate>
Files only
</translate>
{{Excerpt|Lorem ipsum|only=files|hat=no}}
<translate>
Infobox only
</translate>
{{Excerpt|Extension:CategoryLockdown|only=templates|templates=Extension|this=This infobox is}}
Excerpt Release status: stable |
|
---|---|
Implementation | Lua error: callParserFunction: function "#translation" was not found. |
Description | Restrict permissions by category and group |
Author(s) | Sophivorustalk |
Latest version | Lua error: callParserFunction: function "#translation" was not found. (2021-12-13) |
MediaWiki | Lua error: callParserFunction: function "#translation" was not found. |
PHP | Lua error: callParserFunction: function "#translation" was not found. |
Database changes | No |
Composer | Lua error: callParserFunction: function "#translation" was not found. |
License | Lua error: callParserFunction: function "#translation" was not found. |
Download | |
Example | [1] |
Lua error: callParserFunction: function "#translation" was not found. |
|
Lua error: callParserFunction: function "#translation" was not found. |
|
Quarterly downloads | Lua error: callParserFunction: function "#translation" was not found. |
Public wikis using | Lua error: callParserFunction: function "#translation" was not found. |
Translate the Excerpt extension if it is available at translatewiki.net |
<translate>
No infobox
</translate>
{{Excerpt|Extension:CategoryLockdown|templates=-Extension}}
The CategoryLockdown extension allows admins to restrict permissions by category and group.
<translate>
Portal
</translate>
{{Excerpt|Lorem ipsum|files=1|references=no|hat=no|more=yes}}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<translate>
See also
</translate>
<translate>
Template data
</translate> Lua error in Module:TNT at line 124: mw.text.jsonEncode: Cannot use type 'boolean' as a table key.