Template:Transclude random excerpt/doc

This is an old revision of this page, as edited by Certes (talk | contribs) at 12:33, 13 May 2018 (+fileargs). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Transclude random excerpt transcludes the lead of an article as an excerpt. It is designed for use in portals. 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
  • noinclude sections
  • references and footnotes
  • images, unless specifically retained

Usage

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 paragraphs=1,3-5; the default is all paragraphs.
  • A list of file (image) numbers such as files=1; the default is no images. Note that images within infoboxes etc. are not available.
  • Arguments to pass to File: such as fileargs=left to move images to the left; the default is none.
  • A link to the article itself such as more=(more); the default is no link. Short cut: more= produces Read more...
  • errors= to allow Lua error messages to appear in the output

paragraphs= and files= each accept a comma-separated list containing numbers and/or number ranges in the format min-max.

TemplateData

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Transclude random excerpt in articles based on its TemplateData.

TemplateData for Transclude random excerpt

Syntax error in JSON (help)