الگو:Excerpt/توضیحات
| این زیرصفحهٔ مستندات الگو:Excerpt است. این شامل اطلاعات استفاده، الگوها، پیوندهای بین زبانی و سایر اطلاعات است که در اصل الگو صفحه قرار نمیگیرد. |
| این الگو از لوآ استفاده میکند: |
This template is used for transcluding part of an article into another article.
Usage
- To transclude the lead section of an article, use
{{Excerpt|Title of the article}} - To transclude a specific section (excluding the title but including any subsections) use
{{Excerpt|Title of the article|Title of the section}} - To transclude an arbitrary piece of content, first wrap it using
<section begin=Name of the fragment />and<section end=Name of the fragment />, then transclude it using{{Excerpt|Title of the article|fragment=Name of the fragment}}
Problems with references
- Sometimes the transcluded content may contain a reference with the same name as a reference in the transcluding article. This will produce a "duplicate reference name" error. To fix it, simply rename one of the references (it doesn't matter which).
- Sometimes the transcluded content may contain a reference whose body is somewhere else in the transcluded article. This will produce an "unknown reference" error. To fix it, simply move the body of the reference to the transcluded content.
Replacing Template:Main
Excerpts can ویکیپدیا:«از همه مقررات چشمپوشی کنید» یعنی چه؟ be used in place of {{Main}}, after merging the content of the section into the main article. Doing so usually improves the main article as well as the section.
An efficient way to proceed is:
- Open the article with {{Main}} in one tab, and the main article in another (or in two screens, if you have)
- Edit both
- Copy the text of the section with {{Main}} and paste it below the introduction of the main article
- Delete repeated content and adjust with common sense
- Save the changes in the main article with an edit summary like: Merge content from [[Some article]]
- Back to the section with {{Main}}, delete all content and replace it for an excerpt
- Save the changes in the section with an edit summary like: Merge content into [[Main article]] and leave an excerpt
Examples
Lead section
{{Excerpt|Science}}
خطای لوآ: پودمان:TNT:158: Missing JsonConfig extension, or not properly configured; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/Module:Excerpt.tab.
See https://www.mediawiki.org/wiki/Extension:JsonConfig#Supporting_Wikimedia_templates.
Specific section
{{Excerpt|List of continents by population|South America}}
Specific fragment
{{Excerpt|2020 Republican Party presidential primaries|fragment=declared}}
Notes
References
See also
Template data
This template is used for transcluding part of an article into another article.
| پارامتر | توضیحات | نوع | وضعیت | |
|---|---|---|---|---|
| Article | 1 article | Title of the article to transclude
| نام صفحه | ضروری |
| Section | 2 section | Title of the section to transclude
| رشته | اختیاری |
| Fragment | fragment | Name of the fragment to transclude
| رشته | اختیاری |