Content deleted Content added
m "{{TemplateDataHeader}}" --> "{{TemplateData header}}" |
still being added ...hard to keepup |
||
(14 intermediate revisions by 7 users not shown) | |||
Line 1:
{{Documentation subpage}}
{{Lua|Module:Excerpt/portals}}
'''Transclude random excerpt''' transcludes the lead of an article as an excerpt. It is designed for use in [[WP:portal|portal]]s. It returns the text of an article up to but excluding the first header, after removing:
*initial templates such as infoboxes, hatnotes and article improvement tags
Line 8:
===Usage===
<pre style="overflow:auto">{{Transclude random excerpt | 1= | 2= | paragraphs= | files= | fileargs
The template accepts any number of page names as unnamed parameters. One of them is selected randomly, and the page with that title is transcluded. (If the selected page is invalid, the template will choose again.) Include a namespace where necessary. There are no other positional parameters, but there are some optional named parameters:
Line 14:
*A list of file (image) numbers such as <code>files=1</code>; the default is no images. Non-free images are removed.
*Arguments to pass to File: such as <code>fileargs=left</code> to move images to the left; the default is none.
*<code>errors=</code> to allow Lua error messages to appear in the output
*<code>showall=</code> to show all articles simultaneously
paragraphs= and files= each accept a comma-separated list containing numbers and/or number ranges in the format min-max.▼
*<code>list=</code> to show a list of articles <big>{{warnsign| coding not compatible with mobile versions of Wikipedia causing display and accessibility problems}}</big>
▲<code>paragraphs=</code> and <code>files=</code> each accept a comma-separated list containing numbers and/or number ranges in the format min-max. Alternatively, <code>files=</code> can accept the name of a single image, e.g. <code>files=My image file.jpg</code>.
<code>showall=</code> shows all articles simultaneously. This option is intended for a subpage aimed at editors as well as readers. Using this template on a subpage with <code><nowiki><noinclude>|showall=</noinclude></nowiki></code> and transcluding the subpage on a main page will show all excerpts on the subpage but only one on the main page, without repeating the template and its arguments.
{{#section:Template:Transclude lead excerpt/doc|Miscellaneous options}}
===Page options===
{{#section-h:Template:Transclude lead excerpt/doc|Page options}}
===See also===
*{{tl|Transclude lead excerpt}}: specifies the article explicitly
Line 23 ⟶ 28:
*{{tl|Transclude linked excerpt}}: chooses the article randomly from those linked from a page
*{{tl|Transclude selected excerpt}}: chooses the article from a list using an index such as the week number
The templates were discussed at [[Wikipedia:Village_pump_(policy)/Archive_155#Use of direct transclusion in portals and the newer portal transclusion templates|Use of direct transclusion in portals and the newer portal transclusion templates]].
{{Portal templates navbox}}
Line 86 ⟶ 92:
"example": "errors=true",
"default": "false"
},
"showall": {
"label": "ShowAll",
"description": "Show all excerpts simultaneously?",
"type": "string",
"required": false,
"example": "showall={{clear}}{{hr}}",
"default": "no arguments"
},
"list": {
"label": "List",
"description": "Show a list of excerpts?",
"type": "string",
"required": false,
"example": "list=List of articles",
"default": "no list"
}
},
Line 93 ⟶ 115:
<includeonly>{{sandbox other||
[[Category:
}}</includeonly>
|