Template:Transclude random excerpt/doc: Difference between revisions

Content deleted Content added
TemplateData: this cat should not be used directly, it is generated by a WikiProject banner template
still being added ...hard to keepup
 
(19 intermediate revisions by 9 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= | more= | errors= }}</pre>
 
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:
*A list of paragraphs such as <code>paragraphs=1,3-5</code>; the default is all paragraphs.
*A list of file (image) numbers such as <code>files=1</code>; the default is no images. Note thatNon-free images within infoboxes etc. are not availableremoved.
*Arguments to pass to File: such as <code>fileargs=left</code> to move images to the left; the default is none.
*A link to the article itself such as <code>more=(more)</code>; the default is no link. Short cut: <code>more=</code> produces [[Wikipedia|Read more...]]
*<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
*{{tl|Transclude selectedlist item excerpt}} -: chooses the article randomly from athose listlisted usingon an index such as the weeka numberpage
*{{tl|Transclude linked excerpt}}: chooses the article randomly from those linked from a page
*{{tl|Transclude selected current events}}
*{{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}}
 
===TemplateData===
{{TemplateData header}}
{{TemplateDataHeader}}
<templatedata>
{
Line 84 ⟶ 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 91 ⟶ 115:
 
<includeonly>{{sandbox other||
[[Category:EncyclopedicArticle shared content templates]]
}}</includeonly>