Wikipedia:Wikipedia Signpost/Templates/Article list maker/doc
This is a documentation subpage for Wikipedia:Wikipedia Signpost/Templates/Article list maker. It may contain usage information, categories and other content that is not part of the original wikipedia page. |
This template uses Lua: |
This template can be used to create lists of Signpost articles. The Signpost articles can be filtered by tags, by date, and by page; can be sorted by date, page, or title; and can be outputted in formats specified by the user.
Tables
[edit]Premade templates to automatically generate informational tables from issues, months, et cetera can be found here:
Wikipedia:Wikipedia Signpost/Templates/Tables and subpages
|
---|
Filtering articles
[edit]There are over 5000 Signpost articles, so the first step to making a list of them is to filter out the results that you don't need. Here are the parameters that you can use to do that:
page
- If you use this parameter, only the specified page will be outputted.date
- If you use this parameter, only articles for the specified date will be outputted.tags
- Use this parameter to filter the articles by tag. You can specify an unlimited number of tags, separated by commas.tagmatch
- If this is set to "all", then only articles that match all the tags specified intags
will be outputted. Otherwise, articles matching any of the tags will be outputted.startdate
- Don't output any articles before this date.enddate
- Don't output any articles later than this date.author
- Only output articles by this author. This should be the username of the author, without the "User:" prefix (e.g.JPxG
).sortdir
- The direction to sort the articles in, either "ascending" or "descending". The default is "ascending".sortfield
- The field to sort the articles by. Valid options are "date", "page", and "title". The default is "date".start
- Skip X articles from the beginning of the list to be returnedlimit
- Limit the number of articles returned to a specified value
Blank template
[edit]This is the full template, with all possible parameters.
{{Wikipedia:Wikipedia Signpost/Templates/Article list maker | title = | page = | subpage = | fullpage = | tags = | tagmatch = | date = | startdate = | enddate = | author = | sortdir = | sortfield = | start = | limit = | rowformat = | rowtemplate = | rowseparator = }}
Outputting articles
[edit]This template outputs a series of rows, formatted with data from the articles specified using the parameters in #Filtering articles above. It is up to you to specify what parameters appear when in each row. To do this, you have two options, a row format string, or a row template.
Whichever option you choose, you can use the |rowseparator=
argument to specify a custom separator for each row. As a special case, if you use |rowseparator=newline
, the separator will be a new line character.
Parameters
[edit]Both row format strings and row templates take the same parameters, although their syntax is slightly different. Row format strings take parameters that look like ${parameter}
, and row templates take parameters that look like {{{parameter}}}
. The available parameters are:
date
- The article date, e.g.2015-03-25
.page
- The page the article is found on, e.g.Wikipedia:Wikipedia Signpost/2015-03-25/News and notes
.title
- The article title, e.g.Wikimedia Foundation adopts open-access research policy
.subpage
- The subpage name the article is stored on, e.g.News and notes
.fullpage
- The page the article is found on. If any tags matched this article, the first one in alphabetical order is used as the fragment (the section link). If the user specified|tags=research
, this might beWikipedia:Wikipedia Signpost/2015-03-25/News and notes#research
, and if they specified|tags=newsandnotes, research, wmf
it might beWikipedia:Wikipedia Signpost/2015-03-25/News and notes#newsandnotes
.
Row format strings
[edit]Row format strings are specified with the |rowformat=
parameter. These strings take row parameters that look like ${date}
, ${page}
and ${title}
.
For example, the following code:
{{Wikipedia:Wikipedia Signpost/Templates/Article list maker | tags = esperanza | rowformat = * ${date}, ${subpage}: [[${page}|${title}]], by ${author} | rowseparator = newline }}
Produces the following output:
- 2005-09-19, Esperanza group: New group aims to promote Wiki-Love, by Flcelloguy
- 2005-10-10, News and notes: News and Notes: French contributor dies, milestones, by Ral315
- 2005-10-24, Esperanza election: First Esperanza Advisory Committee election concludes, by Karmafist
- 2006-01-02, News and notes: News and notes: Appeal for donations, userboxes controversy, by Flcelloguy
- 2006-01-16, News and notes: News and notes: Requests for CheckUser, milestones, by Flcelloguy
- 2007-01-02, Experanza: Esperanza organization disbanded after deletion discussion, by Ral315
- 2013-10-30, WikiProject report: Special: Lessons from the dead and dying, by Mabeenot
Row templates
[edit]- The following is a an automatically updated list of subpages, current as of 20231216003925 ( ):
- Wikipedia Signpost/Templates/Article list maker
- Wikipedia Signpost/Templates/Article list maker/Basic info table
- Wikipedia Signpost/Templates/Article list maker/Basic info table/Archivesall
- Wikipedia Signpost/Templates/Article list maker/Comment section
- Wikipedia Signpost/Templates/Article list maker/Example
- Wikipedia Signpost/Templates/Article list maker/Pageviews
- Wikipedia Signpost/Templates/Article list maker/Pageviews all
- Wikipedia Signpost/Templates/Article list maker/Pageviews all 2
- Wikipedia Signpost/Templates/Article list maker/Pretty item
- Wikipedia Signpost/Templates/Article list maker/Pretty item/Tag
- Wikipedia Signpost/Templates/Article list maker/Pretty item/Tag/styles.css
- Wikipedia Signpost/Templates/Article list maker/Pretty item/styles.css
- Wikipedia Signpost/Templates/Article list maker/Snippet
- Wikipedia Signpost/Templates/Article list maker/Snippet/doc
- Wikipedia Signpost/Templates/Article list maker/View count
- Wikipedia Signpost/Templates/Article list maker/doc
- Wikipedia Signpost/Templates/Article list maker/sandbox
Row templates are specified with the |rowtemplate=
parameter. This must be the title of a template that is used to format the rows. Row templates take parameters that look like {{{date}}}
, {{{page}}}
and {{{title}}}
.
For example, Wikipedia:Wikipedia Signpost/Templates/Article list maker/Example has the content:
* {{{date}}}, {{{subpage}}}: [[{{{page}}}|{{{title}}}]]
And the code:
{{Wikipedia:Wikipedia Signpost/Templates/Article list maker | tags = esperanza | rowtemplate = Wikipedia:Wikipedia Signpost/Templates/Article list maker/Example | rowseparator = newline }}
Produces the following output:
- 2005-09-19, Esperanza group: New group aims to promote Wiki-Love
- 2005-10-10, News and notes: News and Notes: French contributor dies, milestones
- 2005-10-24, Esperanza election: First Esperanza Advisory Committee election concludes
- 2006-01-02, News and notes: News and notes: Appeal for donations, userboxes controversy
- 2006-01-16, News and notes: News and notes: Requests for CheckUser, milestones
- 2007-01-02, Experanza: Esperanza organization disbanded after deletion discussion
- 2013-10-30, WikiProject report: Special: Lessons from the dead and dying
While row templates require you to create an extra page, they have the advantage of allowing you to process the parameters with parser functions, etc. For example, you could include the code {{#time: Y | {{{date}}} }}
to output the year only.
No articles
[edit]If the filter parameters you specify result in no articles being selected, you can use the |noarticles=
parameter to specify the text to include where the articles would be. The default is the text "No articles found for the arguments specified".
Example:
{| class="wikitable" ! Articles {{Wikipedia:Wikipedia Signpost/Templates/Article list maker | tags = asdfasdfasdf | rowformat = {{!}}- {{!}} [[${page}|${title}]] | noarticles = {{!}}- {{!}} style="color: red" {{!}} No articles could be found for your search... | rowseparator = newline }} |}
Articles |
---|
No articles could be found for your search... |
Where this is used
[edit]The following is a (not exhaustive!) list of templates and use cases where this is a dependency.
- Wikipedia:Wikipedia Signpost/Templates/Single talk, which uses the "comment section" template, and is used on pages like Wikipedia talk:Wikipedia Signpost/Single/2022-11-28.
- Wikipedia:Wikipedia Signpost/Author and all its subpages.
- Wikipedia:Wikipedia Signpost/Tag and all its subpages.