Difference between revisions of "Template: GeneratePageListDPL"
Line 33: | Line 33: | ||
|resultsheader=There are %PAGES% pages | |resultsheader=There are %PAGES% pages | ||
}}|You must specify a pagename pattern so the query is not unlimited.}}</source> | }}|You must specify a pagename pattern so the query is not unlimited.}}</source> | ||
+ | </noinclude> | ||
<onlyinclude> | <onlyinclude> | ||
Line 52: | Line 53: | ||
</onlyinclude> | </onlyinclude> | ||
− | [[Category:Macros]] | + | <noinclude>[[Category:Macros]]</noinclude> |
Latest revision as of 23:25, February 9, 2022
This template is a DPL job aid to generate lists of wiki pages based on the page name, to assist in finding stray pages that may not be part of a manual and that may not predictably use one of the Article-type templates. It can also be used to generate a list of URLs for wiki export. It requires a |pattern parameter, to enforce a baseline limit for the query so that it doesn't risk compromising performance of the entire wiki. It also accepts the following optional parameters to further control the pages to look for:
- draft — Specifies whether to look in the Draft namespace. There are three possible values for this parameter:
- yes = Looks for pages in the Draft namespace (i.e., the pagename pattern starts with Draft:)
- no = Looks for non-Draft pages (i.e., the pagename pattern does not start with Draft:)
- both = Looks for both draft and published pages. This is also the default if the parameter is not specified.
- notpattern — To specify what URL patterns to exclude.
- uses — Finds pages using a particular template. This is particularly useful if it's not a Cargo template.
- notuses — Finds pages not using a particular template.
- firstrevisionsince — Finds pages edited since a particular date in YYYY-MM-DD format.
- lastrevisionbefore — Finds pages last edited before a particular date in YYYY-MM-DD format.
- createdby — Finds pages created by the specified user.
- notcreatedby — Finds pages not created by the specified user.
- modifiedby — Finds pages edited by the specified user.
- notmodifiedby — Finds pages not edited by the specified user.
The last few parameters are most useful in combination -- for example, to find pages created by X but modified by Y before or after a specific date.
Content of the template is:
{{#if:{{{pattern|}}}|
{{#dpl:
|{{#switch:{{{draft|}}}|yes=namespace=Draft|no=namespace=|both|#default=}}
|titlematch={{{pattern}}}
|nottitlematch={{{notpattern|}}}
|uses={{#if:{{{uses|}}}|Template:{{{uses}}}|}}
|notuses={{#if:{{{notuses|}}}|Template:{{{notuses}}}|}}
|firstrevisionsince={{{firstrevisionsince|}}}
|lastrevisionbefore={{{lastrevisionbefore|}}}
|createdby={{{createdby|}}}
|notcreatedby={{{notcreatedby|}}}
|modifiedby={{{modifiedby|}}}
|notmodifiedby={{{notmodifiedby|}}}
|resultsheader=There are %PAGES% pages
}}|You must specify a pagename pattern so the query is not unlimited.}}
You must specify a pagename pattern so the query is not unlimited.