Criteria for page selection


 * You can select articles based on:
 * The category/categories they are assigned to, or the number of categories.
 * Their namespace.
 * Their references/links to and from other articles.
 * Their usage of templates.
 * The author/editor of articles.
 * Their title.
 * Their character. (#redirect or normal article)
 * Their revision date.
 * You can restrict the number of articles to a certain limit:
 * Via configuration settings within the DPL3 source.
 * Via a specific parameter for a given invocation of DPL3.


 * You can select a subset from the result list by random.
 * You can also change or cut off the articles' names at a certain length

Important:
 * Different types of page selection criteria can be used, one after the other, to further restrict or refine page selection (though care to select the most appropriately narrow selection method is ideal).
 * Before applying format, ordering, or adjusting output volume, it is generally advised to view your page selection output first (to determine it works as expected).

category
Syntax:

or or

You can either use the pipe symbol for logical OR, or you can use the & symbol for logical AND. Mixing both is not possible! If you specify more than one  line, their arguments will be implicitly connected with AND. Thus, you can build a logical expression where you have several AND terms, with each term consisting of an OR group of categories.

Example:

Result:

Notes:
 * You can specify the set of Uncategorized pages as a normal category, with the keyword, for example:
 * for uncategorized pages only.
 * or  for the Uncategorized or the Animals category.
 * for the Mammals category, uncategorized pages or the Insects category).


 * If you put a  before the name of a category, DPL3 will add all DIRECT subcategories of that category to your statement.
 * Using TWO asterisks will extend the tree search to two levels. This provides some minimal support for hierarchies of categories. The syntax and/or semantics of this feature might be changed in a future version.

Example:

Result:

If  and   are enabled, you can restrict the categories you want as headings in the result by preceding the list of categories (specified with the category parameter) with   or   (see the example below).
 * A  means that only the categories listed in that statement are allowed to appear as headings in the output.
 * A  means that the categories listed in that statement are NOT allowed to appear as headings in the output (but all others).

Example:

Result:

Notes:


 * If you want to use magic word like,  ,   etc., in the category name, you must use the parser function  variant.
 * To prevent a DPL3 query from returning huge output (or consuming too many resources) there are some configuration variables (see DynamicPageList3 on MediaWiki Wiki):


 * Using the  statement without an argument will have no effect (note that in previous DPL3 versions, this acted like  ).

categorymatch
Syntax:

A  is used to denote "any number of any characters".

Example:

Result:

categoryregexp
The complete text behind "categoryregexp" will be taken as ONE argument and used in a SQL REGEXP clause, i.e.,  characters can be used as a normal part of the regexp.

notcategory
Syntax:

Example:

Result:

Notes:


 * If you use the parser function syntax you will be able to use magic words like,  ,   etc. in the category name.
 * Related DPL3 extension variables (see DynamicPageList3 on MediaWiki Wiki):

categoriesminmax
Syntax:

Example:

Result:

Example:

Result:

namespace
Syntax:

Notes:
 * The namespace name may be any, assuming it represents a valid namespace in the system, including custom ones, BUT no pseudo-namespace such as Media, Special which have negative namespace IDs.
 * The empty string is the main article namespace for example:
 * for pages in Main namespace only.
 * or  for Main or Talk namespace.
 * for User, Main, or Category, etc.).


 * Name spaces are case-sensitive,  will work, but   will not.
 * Instead of using the title of a namespace, you can also use its numeric ID — although this is not recommended; DPL3 will always try to interpret the argument as a name first. So, if you create a user namespace with the title "1" (which is possible in principle) DPL3 will take this namespace if given a "1" as an argument. In this case, the "Talk" namespace (which has the numeric id '1') cannot be specified by its number, but only by the literal "Talk".

Example:

Result:

Example (with magic word):

notnamespace
Syntax:

Example:

Result:

Example (with magic word):

linksfrom
Syntax:

The page mentioned in the DPL3 query can be retrieved via.

Example:

Result:

Notes:
 * Normally  will only show existing pages. With   this can be changed.
 * The  parameter can be used to control the amount of output you get.

openreferences
Syntax:

where criteria can be one of:
 * — Pages that do not exist are included — will conflict with some options; implicitly sets.
 * — Only includes pages that do not exist from missing articles in the pagelinks table; will conflict with some options. Implicitly sets.
 * This option may be useful to create a list of wanted pages (redlinks) (e.g., wanted pages for a specific namespace).


 * — Pages that do not exist are excluded — (default, needs not be specified).

Example:

Result:

notlinksfrom
Syntax:

Similar to, you could use the   magic word, and not include any pages linked to from the current page. This, however, will generally result in errors.

linksto
Syntax:

The page mentioned in the DPL3 query can be retrieved via.

A  character can be used as a wildcard (SQL-LIKE expression).

If you specify more than one linksto condition, they will act as a logical AND. In this case, the  variable will point to the FIRST condition.

Example:

Result:

Note: If two criteria are set, and a page links to both it will appear twice in the output. Use  to see the name of the page it links to.

Example (with magic word):

Note: The  parameter can be used to control the amount of output you get.

notlinksto
Syntax:

Example:

Result:

Notes:
 * The implementation of this feature is not very efficient. Use with care and avoid huge result sets.
 * The  parameter can be used to control the amount of output you get.

linkstoexternal
Syntax:

This command selects pages which contain external http links that match a certain pattern. The pattern is used in SQL LIKE expression, i.e.,  and   are treated as special symbols that match any character respecting a group of arbitrary characters.

Notes:
 * The pattern is case-sensitive.
 * The pattern is matched against the whole URL. Therefore,  is required around the pattern if only part of a string is given:


 * If you specify more than one linkstoexternal item, a page must match ALL conditions (logical AND).
 * The URL of the external link can be retrieved via.
 * See also the  parameter.

imageused
Syntax:

Example:

As you can see, the Namespace 'Image' need not be specified.

Note: There is a variable  which contains the image name(s) used for selection.

imagecontainer
Syntax:

Example:

See: Display images used (example) for more image-related examples.

uses
Syntax:

The "Template" namespace must be specified. You can also specify another namespace if you like.

Example:

Result:

Note: It is not possible to find pages that use 2 templates (e.g., Template:Foo AND Template:Bar).

notuses
Syntax:

Example:

usedby
Syntax:

Example:

createdby
Syntax:

Notes (applies for all user related selection criteria):


 * You can combine user related selections. For example, you could search for pages which were not created by 'user1' but modified by them, or you could search for pages which were created by 'user1' and  'user'. You can also show several or all versions of such articles by specifying one or more of the "revision" group of parameters, like.

notcreatedby
Syntax:

Note: To avoid huge result sets, this will typically be accompanied by other selection criteria.

modifiedby
Syntax:

Note:  will always be a superset of   as the creation of a page is interpreted as its first modification.

notmodifiedby
Syntax:

Note: To avoid huge result sets, this will typically be accompanied by other selection criteria.

lastmodifiedby
Syntax:

notlastmodifiedby
Syntax:

Note: To avoid huge result sets, this will typically be accompanied by other selection criteria.

Select articles based on TITLE
There are several possibilities to select articles by their title. When the titles of matching articles are displayed later in the output list, their names can be shown in different ways: The namespace may be shown or skipped and even parts of the name can be changed. See,  ,   and   for details.

title
Syntax:

Given its unique behavior, specifying an exact "title" makes sense if you want to transclude contents from one specific (other) page, e.g., all content, a page section, labeled sections, or template calls. Thus, DPL may serve as a more flexible alternative to Labeled Section Transclusion.

Since selecting a "title" automatically sets, and no output is given by default, you must specify some type of  statement to get output. You can present the content as-is directly from the include statement, or format that output either by setting other types of formatting (or a combination of compatible formatting types), or by specifying a in the   statement (see   for more information).

Example:

titlelt (Previously title&lt;)
Syntax:

The string given need not be a valid page title.

Example:

Result:

Notes:
 * It may be easiest to remember that the last two letters of  ("lt") correspond to letters in "left", and so provides result(s) to the left of (or before/previous to) the article specified; where the letters of   ("gt") correspond to letters in "right", and so provides result(s) to the right of (or after/next to) the article specified.
 * This may be useful to develop navigation between pages in the same category. In parser function syntax,  could be set to   and used to compose a left/previous navigation button. Then   be used for right/next navigation.
 * If this parameter is set together with 'ASCENDING' order and a  limit, you will get the pages which are immediately 'below' the given string. This may allow efficient navigation through huge result sets.
 * For other methods of scrolling navigation between items in a category, see.

titlegt (Previously title&gt;)
Syntax:

The string given need not be a valid page title.

Example:

Result:

Notes:


 * It may be easiest to remember that the last two letters of  ("gt") correspond to letters in "right", and so provides result(s) to the right of (or after/next to) the article specified; where the last two letters of   ("lt") correspond to letters in "left", and so provides result(s) to the left of (or before/previous to) the article specified.
 * This may be useful to develop navigation between pages in the same category. In parser function syntax,  could be set to   and used to compose a right/next navigation button. Then   be used for left/previous navigation.
 * If this parameter is set together with 'ASCENDING' order and a count limit, you will get the pages which are immediately 'above' the given string. This may allow efficient navigation through huge result sets.
 * For other methods of scrolling navigation between items in a category, see.

scroll
Syntax:

If this command is given, DPL will interpret some special arguments in the URL.

DPL_count      limit number of pages to show DPL_offset     where to start (nth page) DPL_refresh    whether to purge the special DPL cache or not DPL_fromTitle  page name to start after (will be passed to title< ) DPL_toTitle    page name to end with (will be passed to title>, needed for reverse scroll) DPL_findTitle  page name to start with (will be passed to title>= ) DPL_scrolldir  direction of scroll (can be 'up' or 'down')

For details, see.

titlematch
Syntax:

Example:

Example:

Notes:


 * The match is case-sensitive, even with respect to the first character; to make it case-insensitive, use the parameter.
 * Spaces are translated to  (escaped underscore) as MediaWiki internally stores names with underscores instead of spaces. Using an underscore in your   argument means 'any single character' in SQL LIKE expressions.

titleregexp
Syntax:

Example:

nottitlematch
Syntax:

Example:

nottitleregexp
Syntax:

The expression will be used as a REGEXP argument in a SQL query. Namespaces are ignored, as the  parameter can be used to further narrow the selection.

includematch
Syntax:

The idea is that a page will only be selected (and its contents included) if the contents to be included matches a regular expression. In case of (heading based) chapter inclusion and labeled section inclusion, the relevant contents of the page must match the pattern; in case of template based matching it is the complete wikitext of the calling code of your template which is tested against your regular expression. Be careful to design your regexp in a proper way so that it can match all syntactical variations, and note that we use Perl regular expressions. This means that you must delimit your regexp with two identical characters that are not part of the regexp itself, e.g., with. Otherwise, you will see strange error messages from the php interpreter...

If you are not familiar with regular expressions and/or do not know the specifics of Perl regexp used in PHP, before using  it may be helpful to see:
 * The PHP manual for more information.
 * tutorialrepublic for a brief overview.
 * regexr for testing regular expressions.

For named parameters you should use something like this, to be on the safe side: includematch=/\|\s*myParameter\s*=\s*myPattern/s
 * Thus, you can put spaces around the  and use linebreaks in your original article when calling the template—and still, the pattern will match.
 * Note: You must use  to produce a pipe symbol - otherwise the pipe will break the parameter structure of your DPL call.

For unnamed parameters you would specify something like: includematch=/\|\s*myPattern/s

If the parameter is not the last one in your template call, you might use: includematch=/\|\s*myPattern\s*\|/s

See the  parameter.

Example:

Note(s):


 * In combination with templates, the regexp matching will only work if you produce some output at all via the  statement. So, if you call a dummy parameter only or if you call a phantom template that does not produce any output, you will see no matches. It is, however, sufficient to produce a space character to get output. It is not necessary to output the parameter which matches your regexp.
 * Remember, pipe must be replaced with either, or with broken pipe   in   when parser function    is used, or the statement won't work because it the pipe would be mistaken as a field delimiter for #dpl itself and break the parameter structure of your DPL call.

If you want to stop the pattern matching at field boundaries (i.e., at pipe characters) you might use:

Parser function syntax (note that broken pipe  is used). includematch=/languages\s*=\s*[^¦]*English/s

Parser extension syntax (note that regular pipe  is used). includematch=/languages\s*=\s*[^|]*English/s

Example:

includematchparsed
Works exactly like but the contents will be parsed before it is tested against the regular expression.

includenotmatch
Syntax:

The idea is that a page will only be selected (and its contents included) if the contents to be included does not match a given regular expression. In case of (heading based) chapter inclusion and labelled section inclusion, the relevant contents of the page must not match the pattern; in case of template based matching, it is the calling code of your template which must not match the regular expression. Be careful to design your regexp in a proper way so that it covers all syntactical variations. You should use something like includenotmatch=myParameter\s*=\s*myPattern/s to be on the safe side. Thus, you can put spaces around the '=' and use linebreaks in your original article when calling the template—and still, the pattern will do its job.

See the  parameter.

Example:

includenotmatchparsed
Works exactly like but the contents will be parsed before it is tested against the regular expression.

Select articles based on REVISION dates
By default, DPL uses "Y-m-d H:i:s" to display date and time. Note that MediaWiki stores all dates/times in UTC format. When displaying a time stamp, DPL will translate it according to
 * 1) the timezone preference (difference to UTC/GMT) given by the user in his user settings
 * 2) if no preference is given and for all anonymous users, the local time on the server will be used.

So you will either see a time based on your local time (browser based) or based on the timezone in which the wiki server is running.

The same kind of translation applies to dates you specify when selecting articles by revision date/time.

lastrevisionbefore
Syntax:

dateandoptionaltime is a numeric string of up to 14 digits, like "200812041300" (4th of Dec, 2008, 13:00). The string may contain separation characters like "2008/12/04--13:00".

Note: if this parameter is used, the variable  will contain the revision of the selected page(s).

firstrevisionsince
Syntax:

dateandoptionaltime is a numeric string of up to 14 digits, like "200812041300" (4th of Dec, 2008, 13:00) The string may contain separation characters like "2008/12/04--13:00".

Note: if this parameter is used, the variable  will contain the revision of the selected page(s).

allrevisionsbefore
Syntax:

dateandoptionaltime is a numeric string of up to 14 digits, like "200812041300" (4th of Dec, 2008, 13:00) The string may contain separation characters like "2008/12/04--13:00".

Note: if this parameter is used, the variable  will contain the revision of the selected page(s).

allrevisionssince
Syntax:

dateandoptionaltime is a numeric string of up to 14 digits, like "200812041300" (4th of Dec, 2008, 13:00) The string may contain separation characters like "2008/12/04--13:00".

Note: if this parameter is used, the variable  will contain the revision of the selected page(s).

maxrevisions
Syntax:

number must be greater or equal than 1.

minrevisions
Syntax:

number must be greater or equal than 1. In practice, only values of 2 or greater make sense. Using a value of 2, you could exclude freshly created pages from a result set.

articlecategory
Syntax:

If you want to select articles in  you can use this statement to define (in addition) a category for an article with identical name in namespace 0 (default namespace).

includesubpages
Syntax:

As subpages are by default always included, only 'no' or 'false' makes sense as an argument for.

redirects
Syntax:

where criteria can be one of:
 * — redirect pages are allowed in lists.
 * — lists only redirect pages in lists.
 * — redirect pages are excluded from lists — (default, needs not be specified).

Example:

Note: this parameter does not show pages that link to the redirect (as Special:Whatlinkshere/United States does); only redirect pages themselves.

minoredits
Example:

where criteria can be one of:
 * — minor edits are excluded from lists.
 * — minor edits are included in lists — (default, needs not be specified)

Example:

stablepages
Syntax:

where criteria can be one of:
 * — stable pages are excluded from lists.
 * — only stable pages appear in lists.
 * — stable pages appear in lists — (Default, needs not be specified).

Note: This parameter is only useful if your wiki uses FlaggedRevs; it allows you to control whether pages flagged as 'stable' will be part of the DPL result or not.

qualitypages
Syntax:

where criteria can be one of:
 * — quality pages are excluded from lists
 * — only quality pages appear in lists.
 * — quality pages are included in lists — (default, needs not be specified)

Purpose: This parameter is only useful if your wiki uses FlaggedRevs. It allows you to control whether pages flagged as 'quality pages' will be part of the DPL result or not.

skipthispage
Syntax:

The default is, i.e., a query from a page will not include that page itself, even if it otherwise meets the query's criteria. Setting this parameter to 'no' may lead to runtime errors which are hard to track down. You should only use that parameter if your query is straightforward in its structure, and you need the current page to show up in the result (if it matches the selection criteria).

count
Syntax:

, with  a positive integer

A blank value for unlimited. It is limited to 500 by default, depending on extension variables (see DynamicPageList3 on MediaWiki Wiki):.

Example:

If 'count' is missing, it can be set from outside via the URL parameter.

scroll
Syntax:

Huge result sets can be split into smaller parts. DPL allows you to fetch parts of a huge result set by setting auxiliary selection criteria. section has links that demonstrates the principle. It uses a Scroll helper template which generates links to scroll forward and backward through a long result list. To make this possible, it relies on variables which give the name of the first and last result item actually shown. The command  is used to fill these variables with proper values and to set the title limits according to URL parameters derived from these variables.

See also.

offset
Syntax:

where n is number of result lines to skip, (integer) — (default = 0)

Example:

Notes:


 * You could put a DPL query into a template and make count & offset parameters. Calling this template with different values will allow you to display different portions of the result list.
 * if you use  the numbers will be adjusted to reflect the absolute position of the entries, i.e., in the above example you will see numbers starting from 11.
 * If 'offset' is missing, it can be set from outside via the URL parameter DPL_offset.

randomcount
Syntax:

where n is a positive integer.

If randomcount is larger than the number of results, the complete result set will be displayed.

Example:

randomseed
Syntax:

where n is a positive integer.

Example:

distinct
Syntax:

where critria can be one of:
 * — a page can occur more than once in the output.
 * — only once will a page appear in the output if more than one page is specified for  or , and the same page is referenced by more than one.
 * — a page will occur only once in the output — (default, needs not be specified)

Works in connection with  and , however, a page can occur more than once in the output. This happens if you specify more than one page for the  or   parameter, and the same page contains links to more than one of them  or if the same page is referenced by more than one of them. If you want to see a page only once also in these cases, use.

On the other hand, if you wish to see multiple result entries, you should switch this to. This may make sense in combination with  or   if you want to see how many links from one document to another document exist.

ignorecase
Syntax:


 * — comparisons are case-insensitive (only true makes sense as an argument)
 * — comparisons are case-sensitive — (default, needs not be specified)

The parameter has an effect on,  ,  ,   and their  -equivalents.

Note: For case-insensitivity in ordering result sets, see.