Criteria for page selection

Articles can be selected based on: Article result counts can be restricted to a certain limit: A subset of results can be selected by random.
 * 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 titles.
 * Their character (redirect or normal article).
 * Their revision date.
 * Via configuration settings within the DPL3 source.
 * Via a specific parameter for a given invocation of DPL3.

Important:
 * Care to select the most appropriately narrow selection criteria is ideal to avoid large result sets; for testing and display purposes, the  parameter can also be used.
 * Before applying format, ordering, or adjusting output volume, it is generally advised to view page selection results first (to confirm it works as expected).

category
Syntax:

or or

Either the  broken pipe can be used for logical, or the   symbol can be used for logical , mixing both is not possible! If more than one   line is specified, their arguments are implicitly connected with. Thus, a logical expression can be built using several terms, with each term consisting of an  group of categories.

Example:

Result:

Notes:
 * A set of Uncategorized pages can be specified 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  is put before the name of a category, DPL3 adds all DIRECT subcategories of that category to the statement.
 * Using TWO asterisks extends 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, categories output as headings in the result can be restricted by preceding the list of categories (specified with the category parameter) with   or  :
 * – Only the categories listed in the statement are allowed to appear as headings in the output.
 * – The categories listed in the statement are NOT allowed to appear as headings in the output (but all others).

Example:

Result:

Notes:


 * To use magic words in the category name, the parser function method must be used.
 * To prevent a DPL3 query from returning huge output (or consuming too many resources) there are some configuration variables, for related configuration settings also see the complete list of DynamicPageList3 configuration variables.
 * Using the  statement without an argument will have no effect (note that in previous DPL3 versions, this acted like  ).

categorymatch
Syntax:

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

Example:

Result:

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

Note:

notcategory
Syntax:

Example:

Result:

Notes:


 * To use magic words in the category name, the parser function method must be used.
 * There are some related configuration variables, also see the complete list of DynamicPageList3 configuration variables.

notcategoryregexp
Note:

categoriesminmax
Syntax:

where and  are each a desired number.

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,  works, but   does not.
 * Instead of using the title of a namespace its numeric ID can be used, although this is not recommended; DPL3 always tries to interpret the argument as a name first. So, if a user namespace is created with the title "1" (which is possible in principle) DPL3 takes 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:

Example:

Result:

Notes:
 * Normally  only shows existing pages. With   this can be changed.
 * The  parameter can be used to control the amount of output received.
 * The page mentioned in the DPL3 query can be retrieved via  variable.

openreferences
Syntax:

where can be one of:
 * – Pages that do not exist are included – conflicts with some options; implicitly sets.
 * – Only includes pages that do not exist from missing articles in the pagelinks table; conflicts 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, need not be specified).

Example:

Result:

notlinksfrom
Syntax:

Similar to  the   magic word could be used, to not include any pages linked to from the current page; however this generally results in errors.

linksto
Syntax:

Notes:
 * can be used as a wildcard (SQL-LIKE expression).
 * If more than one criterion is specified, they act as a logical . In this case, the  variable points to the first condition.
 * can be used to display the name of the page linking to the criteria specified.
 * If two criteria are set, and a result links to both, the result appears twice in the output.
 * The  parameter can be used to control the amount of output received.

Example:

Result:

Example (with magic word):

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 received.

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 more than one  parameter is specified, articles must match all conditions (logical ).
 * The URL of the external link can be retrieved via.
 * See also the  parameter.

imageused
Syntax:

The Namespace "File" need not be specified.

Example:

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

imagecontainer
Syntax:

Example:

See: Images used (examples) for more image-related examples.

uses
Syntax:

The "Template" namespace must be specified, or other namespaces can be specified.

Example:

Result:

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

notuses
Syntax:

Example:

usedby
Syntax:

Example:

createdby
Syntax:

Notes (applies for all user related selection criteria):


 * User related selections can be combined. For example, pages which were not created by but modified by them could be specified, or pages which were created by  and    could be specified.
 * Several or all versions of articles can be shown by specifying one or more of the "revision" group of parameters, like.

notcreatedby
Syntax:

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

modifiedby
Syntax:

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

notmodifiedby
Syntax:

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

lastmodifiedby
Syntax:

notlastmodifiedby
Syntax:

Note: To avoid huge result sets, this is 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 transcluding (including) contents from one specific page is desired. E.g., All content, a page section, labeled sections, or template calls of one page. Thus, DPL may serve as a more flexible alternative to Labeled Section Transclusion.

Using this parameter causes the following:
 * is automatically set, causing no output to be given by default until specified.
 * Some type of  statement must be specified to get output.
 * The content can be presented as-is directly from the include statement, or the output can be formatted:
 * By setting  arguments.
 * By using other types of formatting (or a combination of compatible formatting types).
 * By specifying a.
 * Specified formatting affects if article title is displayed, is repeated, and/or if results appear separated or grouped.
 * If there is more than one section with the same name, the contents of each are displayed one after the other.
 * When content is formatted using, by default each result with the same name appears in a separate row with a separate heading, as can be seen in the example for including page sections.
 * The  variable can be used, but only in , to retrieve page section/chapter heading text.

Example:

titlelt (Previously title&lt;)
Syntax:

The given need not be a valid page title.

Example:

Result:

Notes:
 * It may be helpful to remember:
 * The last two letters of  ("lt") correspond to letters in "left", so result(s) to the left of the article specified are returned.
 * This parameter may allow efficient navigation between pages in the same category or result set, or large result sets.
 * In DPL3 parser function syntax method:
 * could be set to, a   of one, and used to compose a left/previous navigation.
 * could be set to, a   of one, and used to compose a right/next navigation.
 * For other methods of scrolling navigation between items in a category, that makes implicit use of this parameter, see.

Combined (multipart) Result:

titlegt (Previously title&gt;)
{{Example|

Syntax:

The string given need not be a valid page title. {{note|This parameter was standardized to  and it is recommended to switch instances to the new wording. For compatibility purposes,  continues to work.}}

Example: {{#lsth:Examples/Parameter: titlegt (example 1)|Example}} {{ViewTest|Examples|Parameter: titlegt (example 1)}}

Result: {{#lsth:Examples/Parameter: titlegt (example 1)|Result}}

Notes:


 * It may be helpful to remember:
 * The last two letters of  ("gt") correspond to letters in "right", so result(s) to the right of the article specified are returned.
 * This parameter may allow efficient navigation between pages in the same category or result set, or large result sets.
 * In DPL3 parser function syntax method:
 * could be set to, a   of one, and used to compose a right/next navigation.
 * could be set to, a   of one, and used to compose a left/previous navigation.
 * For other methods of scrolling navigation between items in a category, that makes implicit use of this parameter, see {{DPL|scrolling}}.

titlematch
Syntax:

Example:

Example:

Notes:


 * The match is case-sensitive, even regarding 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:

Note:

nottitlematch
Syntax:

Example:

nottitleregexp
Syntax:

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

Note:

includematch
Syntax:

The idea is that a page is only selected (and its contents included) if the contents to be included matches a regular expression. In the case of (heading based) chapter inclusion and labeled section inclusion, the relevant contents of the page must match the pattern; in the 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 the regext must be delimited with two identical characters that are not part of the regexp itself, e.g., with. Otherwise, strange error messages are gievn from the PHP interpreter.

Note:

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

For unnamed parameters something like the following could be specified includematch=/\|\s*myPattern/s

If the parameter is not the last one in the template call, this might be used: includematch=/\|\s*myPattern\s*\|/s

See the  parameter.

Example:

Note(s):


 * In combination with templates, the regexp matching only works if some output is produced via the  statement. So, if a dummy parameter only is called, or a surrogate/phantom template is called that does not produce any output, no matches are seen. 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, the pipe  must be replaced with either broken pipe   or , or with in   when parser function    is used, or the statement won't work because the pipe would be mistaken as a field delimiter for #dpl itself, and break the parameter structure of the DPL3 call.

To stop the pattern matching at field boundaries (i.e., at pipe characters) something such as this might be used:

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 are parsed before it is tested against the regular expression.

includenotmatch
Syntax:

The idea is that a page is only selected (and its contents included) if the contents to be included does not match a given regular expression. In the case of (heading based) chapter inclusion and labelled section inclusion, the relevant contents of the page must not match the pattern; in the case of template based matching, it is the calling code of the template which must not match the regular expression. Be careful to design the regexp in a proper way, so it covers all syntactical variations. Something like the following should be used to be on the safe side: includenotmatch=myParameter\s*=\s*myPattern/s

Thus, spaces can be put around the  and line breaks used in the original article when calling the template – and still, the pattern will do its job.

See the  parameter.

Example:

Note:

includenotmatchparsed
Works exactly like  but the contents are 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 translates it according to:
 * 1) The timezone preference (difference to UTC/GMT) given by the user in user settings.
 * 2) If no preference is given, and for all anonymous users, the local time on the server is used.

So, either a time based on the user's local time (browser based), or based on the timezone in which the wiki server is running is seen.

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

lastrevisionbefore
Syntax:

where 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  contains/returns the revision of the selected page(s).

firstrevisionsince
Syntax:

where 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  contains/returns the revision of the selected page(s).

allrevisionsbefore
Syntax:

where 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:

where  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).

Example:

Result:

maxrevisions
Syntax:

where must be greater than or equal to 1.

minrevisions
Syntax:

where must be greater or equal than 1.

In practice, only values of 2 or greater make sense. Using a value of, freshly created pages could be excluded from a result set.

articlecategory
Syntax:

To select articles in  this statement could be used to define (in addition) a category for an article with an identical name in namespace 0 (default namespace).

includesubpages
Syntax:

As subpages are by default always included, only or  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, need 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, need not be specified)

Example:

stablepages
Syntax:

where can be one of:
 * – Stable pages are excluded from lists.
 * – Only stable pages appear in lists.
 * – Stable pages appear in lists – (Default, need not be specified).

Note: This parameter is only useful if the wiki uses FlaggedRevs; it controls whether the pages flagged as 'stable' are part of the DPL result or not.

qualitypages
Syntax:

where can be one of:
 * – Quality pages are excluded from lists
 * – Only quality pages appear in lists.
 * – Quality pages are included in lists – (default, need not be specified)

Purpose: This parameter is only useful if the wiki uses FlaggedRevs. It controls whether pages flagges as 'quality pages' are part of the DPL result or not.

skipthispage
Syntax:

– (default is yes, need not be specified and may cause problems if specified).

Notes:
 * The source page of the query is not included in the result set by default, even if it meets the query's criteria.
 * Setting this parameter to no may lead to runtime errors which are hard to track down. This value should only be used if the query is straightforward in structure, and the current page is required in the result set (if it matches the selection criteria).

count
Syntax:

, where is a positive integer.

Notes:


 * DPL3 limits the result count to 500 by default for performance reasons, this can be changed depending on extension configuration variables:
 * – Query result number maximum limit.
 * – Allow unlimited query results, which may result in slow or failed page loads.
 * A blank value sets results to unlimited, which may also result in slow or failed page loads.
 * See DynamicPageList3 more information on all configuration variables.
 * Count can also be set or overridden from outside a DPL3 query, by using the URL parameter.

Example:

scroll
Syntax:

– (default is no which need not be specified, it only makes sense to set yes when required).

DPL3 can take certain URL parameters from the command line, like  and. Within the  and/or   a template can be called that generates links to fetch the next / previous page.

Enabling scrolling does the following:
 * DPL3 enables the acceptance of special scroll URL parameters, such as  and.
 * If these arguments are given, the commands  and   are implicitly be set.
 * To make scrolling possible, DPL3 relies on such variables, which give the name of the first and last result items actually shown.
 * is used to fill the special URL parameters with proper values, and to set the title limits according to URL parameters derived from them.
 * See scroll parameter/URL syntax for use.
 * See scroll/URL parameters for a full list of special parameters.
 * URLs can then be used to create scroll navigation between results in the result set, or a template can be used within the and/or  that generates links to fetch the next / previous page(s).
 * Doing such sets auxiliary selection criteria  and.

This mechanism can be used to create a generic page scroll feature – provided the value of DPL_offset can also be accessed in other templates outside of DPL3. This is where the other parameter  comes in, it stores the URL parameters in a variable which can be accessed via.

Example:

Example:

offset
Syntax:

where is the number of result lines to skip, (integer) – (default = 0)

Example:

Notes:
 * A DPL query could be put into a template with  and   parameters. Calling this template with different values would allow different portions of the result list to be displayed.
 * If   is used, the numbers are adjusted to reflect the absolute position of the entries, i.e., in the above example, numbers starting from 11 are observed.
 * If 'offset' is missing, it can be set from outside via the URL parameter.

randomcount
Syntax:

where is a positive integer.

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

Example:

randomseed
Syntax:

where is a positive integer.

Example:

distinct
Syntax:

where can be one of:
 * – A page can occur more than once in the output.
 * – A page can occur only once in the output if more than one page is specified for  or , and the same page is referenced by more than one.
 * – A page can occur only once in the output – (default, need not be specified)

Works in connection with  and  :
 * A page can occur more than once in the output.
 * This happens if more than one page is specified in  or   parameters, 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.
 * To see a page only once also in these cases, use.
 * To see multiple result entries, set the value to . This may make sense in combination with   or   to see how many links from one document to another document exist.

ignorecase
Syntax:


 * – Comparisons are case-insensitive (only makes sense as an argument)
 * – Comparisons are case-sensitive – (default, need not be specified)

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

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