Criteria for page selection
|
Manual | Parameters | Criteria for page selection |
Articles can be selected 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 titles.
- Their character (redirect or normal article).
- Their revision date.
Article result counts can be restricted to a certain limit:
- Via configuration settings within the DPL3 source.
- Via a specific parameter for a given invocation of DPL3.
A subset of results can be selected by random.
Important:
- Care to select the most appropriately narrow selection criteria is ideal to avoid large result sets; for testing and display purposes, the
count
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).
Select articles based on CATEGORY[edit]
category[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
category | Selects articles based on categories. More than one category can be specified with pipe | (tag syntax) or broken pipe ¦ (parser function syntax) as a separator; the effect being that pages listed have to be at least in one of the categories (logical OR).
If the |
Syntax:
category = 1st category name¦2nd category name¦3rd category name¦...
or
category = 1st category name&2nd category name&3rd category name&...
or
category = _none_
Either the ¦
broken pipe can be used for logical OR, or the &
symbol can be used for logical AND, mixing both is not possible! If more than one category=
line is specified, their arguments are implicitly connected with AND. Thus, a logical expression can be built using several AND terms, with each term consisting of an OR group of categories.
Example:
{{#lsth:Examples/Parameter: category (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Result:
{{#lsth:Examples/Parameter: category (example 1)|Result}}
Notes:
- A set of Uncategorized pages can be specified as a normal category, with the keyword _none_, for example:
category=_none_
for uncategorized pages only.category=_none_¦Animals
ornamespace=Animals¦_none_
for the Uncategorized or the Animals category.category=Mammals¦_none_¦Insects
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:
{{#lsth:Examples/Parameter: category (example 2)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Result:
{{#lsth:Examples/Parameter: category (example 2)|Result}}
If ordermethod=category,...
and headingmode=
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:
{{#lsth:Examples/Parameter: category (example 3)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Result:
{{#lsth:Examples/Parameter: category (example 3)|Result}}
Notes:
- To use magic words in the category name, the parser function syntax 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
category
statement without an argument will have no effect (note that in previous DPL3 versions, this acted likecategory=_none_
).
categorymatch[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
categorymatch | Selects articles based on categories. One or more patterns can be specified (SQL LIKE); a page is selected if at least one of its categories matches at least one of the patterns. |
Syntax:
categorymatch=1st category pattern¦...
%
is used to denote "any number of any characters".
Example:
{{#lsth:Examples/Parameter: categorymatch (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Result:
{{#lsth:Examples/Parameter: categorymatch (example 1)|Result}}
categoryregexp[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
categoryregexp | Selects pages with a category matching a regular expression. |
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: If you are not familiar with regular expressions and/or do not know the specifics of Perl regexp used in PHP, it may be helpful to see:
- The PHP manual and W3Schools for more information.
- RegExr for testing regular expressions.
notcategory[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
notcategory | Much like the category parameter, but requires that every page listed not be in a particular category. Unlike in the category parameter, categories cannot be combined using logical OR, only one criterion can be specified per line.
|
Syntax:
notcategory=category name
Example:
{{#lsth:Examples/Parameter: notcategory (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Result:
{{#lsth:Examples/Parameter: notcategory (example 1)|Result}}
Notes:
- To use magic words in the category name, the parser function syntax method must be used.
- There are some related configuration variables, also see the complete list of DynamicPageList3 configuration variables.
notcategorymatch[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
notcategorymatch | Works like notcategory but based on SQL LIKE. |
notcategoryregexp[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
notcategoryregexp | Works like notcategory but based on SQL REGEXP. |
Note: If you are not familiar with regular expressions and/or do not know the specifics of Perl regexp used in PHP, it may be helpful to see:
- The PHP manual and W3Schools for more information.
- RegExr for testing regular expressions.
categoriesminmax[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
categoriesminmax | Restricts article selection to those assigned to at least [min] categories, and/or at most to [max] categories. |
Syntax:
categoriesminmax=[min],[max]
where min and max are each a desired number.
Example:
{{#lsth:Examples/Parameter: categoriesminmax (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Result:
{{#lsth:Examples/Parameter: categoriesminmax (example 1)|Result}}
Example:
{{#lsth:Examples/Parameter: categoriesminmax (example 2)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Result:
{{#lsth:Examples/Parameter: categoriesminmax (example 2)|Result}}
Select articles based on NAMESPACES[edit]
namespace[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
namespace | Restricts article selection to the given namespace(s). |
Syntax:
namespace=1st_namespace_name¦2nd namespace_name¦3rd_namespace_name¦...
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:
namespace=
for pages in Main namespace only.namespace=¦Talk
ornamespace=Talk¦
for Main or Talk namespace.namespace=User¦¦Category
for User, Main, or Category, etc.).
- Name spaces are case-sensitive,
namespace=User_talk
works, butnamespace=User_Talk
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:
{{#lsth:Examples/Parameter: namespace (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Result:
{{#lsth:Examples/Parameter: namespace (example 1)|Result}}
Example (with magic word):
{{#lsth:Examples/Parameter: namespace (example 2)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
notnamespace[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
notnamespace | Much like the notcategory parameter, but for namespaces. Restricts article selection to those not in the given namespace(s).
|
Syntax:
notnamespace=namespace_name
Example:
{{#lsth:Examples/Parameter: notnamespace (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Result:
{{#lsth:Examples/Parameter: notnamespace (example 1)|Result}}
Example (with magic word):
{{#lsth:Examples/Parameter: notnamespace (example 2)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Select articles based on LINKS[edit]
linksfrom[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
linksfrom | Selects articles that are referenced/linked from at least one of the specified pages. |
Syntax:
linksfrom=full page name¦...'
Example:
{{#lsth:Examples/Parameter: linksfrom (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Result:
{{#lsth:Examples/Parameter: linksfrom (example 1)|Result}}
Notes:
- Normally
linksfrom
only shows existing pages. Withopenreferences=yes
this can be changed. - The
distinct
parameter can be used to control the amount of output received. - The page mentioned in the DPL3 query can be retrieved via
%PAGESEL%
variable.
openreferences[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
openreferences | Extends linksfrom to unresolved references (non-existing articles or image links). Implicitly sets ordermethod=none if set to yes or missing.
|
Syntax:
openreferences=criteria
where criteria can be one of:
yes
– Pages that do not exist are included – conflicts with some options; implicitly setsordermethod=none
.missing
– Only includes pages that do not exist from missing articles in the pagelinks table; conflicts with some options. Implicitly setsordermethod=none
.
- This option may be useful to create a list of wanted pages (redlinks) (e.g., wanted pages for a specific namespace).
no
– Pages that do not exist are excluded – (default, need not be specified).
Example:
{{#lsth:Examples/Parameter: openreferences (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Result:
{{#lsth:Examples/Parameter: openreferences (example 1)|Result}}
notlinksfrom[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
notlinksfrom | Selects articles that are NOT referenced/linked from any of the specified pages. |
Syntax:
notlinksfrom=full page name¦...
Similar to linksfrom
the {{FULLPAGENAME}}
magic word could be used, to not include any pages linked to from the current page; however this generally results in errors.
linksto[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
linksto | Selects articles that link to at least one of the specified pages. |
Syntax:
linksto=full page name¦...
Notes:
%
can be used as a wildcard (SQL-LIKE expression).- If more than one criterion is specified, they act as a logical AND. In this case, the
%PAGESEL%
variable points to the first condition. %PAGESEL%
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
distinct
parameter can be used to control the amount of output received.
- The
Example:
{{#lsth:Examples/Parameter: linksto (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Result:
{{#lsth:Examples/Parameter: linksto (example 1)|Result}}
Example (with magic word):
{{#lsth:Examples/Parameter: linksto (example 2)|Example}} Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
notlinksto[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
notlinksto | Selects articles that do NOT link to any of the specified pages. |
Syntax:
notlinksto=full page name¦...
Example:
{{#lsth:Examples/Parameter: notlinksto (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Result:
{{#lsth:Examples/Parameter: notlinksto (example 1)|Result}}
Notes:
- The implementation of this feature is not very efficient. Use with care and avoid huge result sets.
- The
distinct
parameter can be used to control the amount of output received.
linkstoexternal[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
linkstoexternal | Selects articles that contain an external link that matches a given text pattern. |
Syntax:
linkstoexternal=text pattern¦...
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:
linkstoexternal=%mywebpage%
- If more than one
linkstoexternal
parameter is specified, articles must match all conditions (logical AND). - The URL of the external link can be retrieved via
%EXTERNALLINK%
. - See also the
addexternallink
parameter.
imageused[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
imageused | Selects articles that use a certain image. |
Syntax:
imageused=image name¦...
The Namespace "File" need not be specified.
Example:
{{#lsth:Examples/Parameter: imageused (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Note: There is a variable %IMAGESEL%
which contains the image name(s) used for selection.
imagecontainer[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
imagecontainer | Select images that are contained in one or more articles. |
Syntax:
imagecontainer=page name¦...
Example:
{{#lsth:Examples/Parameter: imagecontainer (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
See: Images used (examples) for more image-related examples.
Select articles based on the use of TEMPLATES[edit]
uses[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
uses | Selects articles that use (transclude) at least one of the specified templates (wiki syntax: {{...}} ).
|
Syntax:
uses=Template:name¦Template:...
The "Template" namespace must be specified, or other namespaces can be specified.
Example:
{{#lsth:Examples/Parameter: uses (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Result:
{{#lsth:Examples/Parameter: uses (example 1)|Result}}
Note: It is not possible to find pages that use two templates (e.g., Template:Foo AND Template:Bar).
notuses[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
notuses | Selects articles that do not use any of the specified templates. |
Syntax:
notuses=Template:name¦Template:...
Example:
{{#lsth:Examples/Parameter: notuses (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
usedby[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
usedby | Selects articles (templates) that are used (transcluded) by a specified page. |
Syntax:
usedby=page
Example:
{{#lsth:Examples/Parameter: usedby (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Select articles based on authors / editors[edit]
createdby[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
createdby | Selects articles that were created by the specified user. |
Syntax:
createdby=username
Notes (applies for all user related selection criteria):
- User related selections can be combined. For example, pages which were not created by user1 but modified by them could be specified, or pages which were created by user1 and
lastmodifiedby
user2 could be specified. - Several or all versions of articles can be shown by specifying one or more of the "revision" group of parameters, like
allrevisionsbefore
.
notcreatedby[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
notcreatedby | Selects articles that were not created by the specified user. |
Syntax:
notcreatedby=username
Note: To avoid huge result sets, this is typically be accompanied by other selection criteria.
modifiedby[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
modifiedby | Selects articles that were created or at least once modified by the specified user. |
Syntax:
modifiedby=username
Note: modifiedby
is always a superset of createdby
as the creation of a page is interpreted as its first modification.
notmodifiedby[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
notmodifiedby | Selects articles that were not (created or) modified by the specified user. |
Syntax:
notmodifiedby=username
Note: To avoid huge result sets, this is typically be accompanied by other selection criteria.
lastmodifiedby[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
lastmodifiedby | Selects articles where the last modification was done by the specified user. |
Syntax:
lastmodifiedby=username
notlastmodifiedby[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
notlastmodifiedby | Selects articles where the last modification was not done by the specified user. |
Syntax:
notlastmodifiedby=username
Note: To avoid huge result sets, this is typically be accompanied by other selection criteria.
Select articles based on TITLE[edit]
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 shownamespace
, replaceintitle
, escapelinks
and titlemaxlength
for details.
title[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
title | Select one single page by its (namespace and) title, sets mode=userformat giving no output by default, and requires an include statement.
|
Syntax:
title=pagetitle
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:
mode=userformat
is automatically set, causing no output to be given by default until specified.- Some type of
include=
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
format=
arguments. - By using other types of formatting (or a combination of compatible formatting types).
- By specifying a surrogate template.
- By setting
- 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
table
, 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
%SECTION%
variable can be used, but only insecseparators
, to retrieve page section/chapter heading text.
- The content can be presented as-is directly from the include statement, or the output can be formatted:
Example:
{{#lsth:Examples/Parameter: title (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
titlelt (Previously title<)[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
titlelt | Restrict the selection to articles with a title less or equal to a given value. |
Syntax:
titlelt=string
The string given need not be a valid page title.
Example:
{{#lsth:Examples/Parameter: titlelt (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Result:
{{#lsth:Examples/Parameter: titlelt (example 1)|Result}}
Notes:
- It may be helpful to remember:
- The last two letters of
titlegt
("lt") correspond to letters in "left", so result(s) to the left of the article specified are returned.
- The last two letters of
- 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:
- For other methods of scrolling navigation between items in a category, that makes implicit use of this parameter, see scrolling.
Combined (multipart) Result:
{{#lsth:Examples/Parameter: titlelt (example 2)|Example}}{{#lsth:Examples/Parameter: titlelt (example 2)|Result}}Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
titlegt (Previously title>)[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
titlegt | Restrict the selection to articles with a title greater or equal to a given value. |
{{Example|
Syntax:
titlegt=string
The string given need not be a valid page title.
Example:
{{#lsth:Examples/Parameter: titlegt (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Result:
{{#lsth:Examples/Parameter: titlegt (example 1)|Result}}
Notes:
- It may be helpful to remember:
- The last two letters of
titlegt
("gt") correspond to letters in "right", so result(s) to the right of the article specified are returned.
- The last two letters of
- 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:
- For other methods of scrolling navigation between items in a category, that makes implicit use of this parameter, see scrolling.
titlematch[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
titlematch | Select articles with a title matching at least one of the specified patterns. The patterns are used as a LIKE argument in an SQL query. Namespaces are ignored, as the namespace parameter can be used to further narrow the selection.
|
Syntax:
titlematch=pattern¦...
Example:
{{#lsth:Examples/Parameter: titlematch (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Example:
{{#lsth:Examples/Parameter: titlematch (example 2)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Notes:
- The match is case-sensitive, even regarding the first character; to make it case-insensitive, use the parameter
ignorecase
. - Spaces are translated to
\_
(escaped underscore) as MediaWiki internally stores names with underscores instead of spaces. Using an underscore in yourtitlematch
argument means 'any single character' in SQL LIKE expressions.
titleregexp[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
titleregexp | Select articles with a title matching the specified regular expressions. The pattern is used as a REGEXP argument in a SQL query. Namespaces are ignored, as the namespace= parameter can be used to further narrow the selection. |
Syntax:
titleregexp=regular expression
Example:
{{#lsth:Examples/Parameter: titleregexp (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Note: If you are not familiar with regular expressions and/or do not know the specifics of Perl regexp used in PHP, it may be helpful to see:
- The PHP manual and W3Schools for more information.
- RegExr for testing regular expressions.
nottitlematch[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
nottitlematch | Select articles with a title not matching any of the specified patterns. The patterns are used as a LIKE argument in a SQL query. Namespaces are ignored, as the namespace= parameter can be used to further narrow the selection. Normally, you would want to use this selection only in combination with other criteria. Otherwise, output could become huge. |
Syntax:
nottitlematch=pattern¦...
Example:
{{#lsth:Examples/Parameter: nottitlematch (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
nottitleregexp[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
nottitleregexp | Select articles with a title that does not match the specified regular expression. Normally, you would want to use this selection only in combination with other criteria. Otherwise, output could become huge. |
Syntax:
nottitleregexp=regular expression
The expression is used as a REGEXP argument in a SQL query. Namespaces are ignored, as the namespace=
parameter can be used to further narrow the selection.
Note: If you are not familiar with regular expressions and/or do not know the specifics of Perl regexp used in PHP, it may be helpful to see:
- The PHP manual and W3Schools for more information.
- RegExr for testing regular expressions.
Select articles based on CONTENTS[edit]
includematch[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
includematch | Controls the selection of articles based on the content that is included from them. |
Syntax:
includematch=regexp1,regexp2,...
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: If you are not familiar with regular expressions and/or do not know the specifics of Perl regexp used in PHP, it may be helpful to see:
- The PHP manual and W3Schools for more information.
- RegExr for testing regular expressions.
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 include
parameter.
Example:
{{#lsth:Examples/Parameter: includematch (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Note(s):
- In combination with templates, the regexp matching only works if some output is produced via the
include
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{{#dpl:}}
syntax 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:
{{#lsth:Examples/Parameter: includematch (example 2)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
includematchparsed[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
includematchparsed | Controls the selection of articles based on (pre-parsed) contents that is included from them. |
Works exactly like includematch
but the contents are parsed before it is tested against the regular expression.
includenotmatch[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
includenotmatch | Controls the selection of articles based on contents that is included from them. |
Syntax:
includenotmatch=regexp1,regexp2,...
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 include
parameter.
Example:
{{#lsth:Examples/Parameter: includenotmatch (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Note: If you are not familiar with regular expressions and/or do not know the specifics of Perl regexp used in PHP, it may be helpful to see:
- The PHP manual and W3Schools for more information.
- RegExr for testing regular expressions.
includenotmatchparsed[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
includenotmatchparsed | Controls the selection of articles based on (pre-parsed) contents that are included from them. |
Works exactly like includenotmatch
but the contents are parsed before it is tested against the regular expression.
Select articles based on REVISION dates[edit]
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:
- The timezone preference (difference to UTC/GMT) given by the user in user settings.
- 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[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
lastrevisionbefore | Selects articles that existed before the specified date, and displays the last revision before that date (this latter date can be accessed using the REVISION variable in mode=userformat ).
|
Syntax:
lastrevisionbefore=dateandoptionaltime
where 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 %REVISION%
contains/returns the revision of the selected page(s).
firstrevisionsince[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
firstrevisionsince | Selects articles that had a revision created after the specified date, and displays that revision date (this latter date can be accessed using the REVISION variable in mode=userformat ).
|
Syntax:
firstrevisionsince=dateandoptionaltime
where 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 %REVISION%
contains/returns the revision of the selected page(s).
allrevisionsbefore[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
allrevisionsbefore | Shows all revisions that existed before the specified date. The date of each revision is shown (and is available as REVISION in mode=userformat ).
|
Syntax:
allrevisionsbefore=dateandoptionaltime
where 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 %REVISION%
will contain the revision of the selected page(s).
allrevisionssince[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
allrevisionssince | Shows all revisions that were created after the specified date. The date of each revision is shown (and is available as REVISION in mode=userformat ). If there was no new revision of an existing article after the specified date, that article will not appear in the output.
|
Syntax:
allrevisionssince=dateandoptionaltime
where 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 %REVISION%
will contain the revision of the selected page(s).
Example:
{{#lsth:Examples/Parameter: allrevisionssince (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Result:
{{#lsth:Examples/Parameter: allrevisionssince (example 1)|Result}}
maxrevisions[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
maxrevisions | Shows an article (or its revisions) only if its number of revisions are less than the value specified. |
Syntax:
maxrevisions=number
where number must be greater than or equal to 1.
minrevisions[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
minrevisions | Shows an article (or its revisions) only if its number of revisions are greater than the value specified. |
Syntax:
minrevisions=number
where number must be greater or equal than 1.
In practice, only values of 2 or greater make sense. Using a value of 2, freshly created pages could be excluded from a result set.
Select articles based on OTHER criteria[edit]
articlecategory[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
articlecategory | Selects a talk page based on the corresponding base article (in the default namespace) category. |
Syntax:
articlecategory= categoryname
To select articles in namespace=Talk
this statement could be used to define (in addition) a category for an article with an identical name in namespace 0 (default namespace).
includesubpages[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
includesubpages | Controls the inclusion or exclusion of pages which have a '/' in their name. The default is true .
|
Syntax:
includesubpages=false
As subpages are by default always included, only no or false makes sense as an argument for includesubpages
.
redirects[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
redirects | Controls the inclusion or exclusion of redirect pages in the output. By default, redirections are not shown. |
Syntax:
redirects=criteria
where criteria can be one of:
include
– Redirect pages are allowed in lists.only
– Lists only redirect pages in lists.exclude
– Redirect pages are excluded from lists – (default, need not be specified).
Example:
{{#lsth:Examples/Parameter: redirects (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Note: this parameter does not show pages that link to the redirect (as Special:Whatlinkshere/United States does); only redirect pages themselves.
minoredits[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
minoredits | Controls the inclusion or exclusion of minor edits in output. Requires ordermethod=[...]firstedit¦lastedit .
|
Example:
minoredits=criteria
where criteria can be one of:
exclude
– Minor edits are excluded from lists.include
– Minor edits are included in lists – (default, need not be specified)
Example:
{{#lsth:Examples/Parameter: minoredits (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
stablepages[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
stablepages | Controls the inclusion or exclusion of pages which are flagged as 'stable'. |
Syntax:
stablepages=criteria
where criteria can be one of:
exclude
– Stable pages are excluded from lists.only
– Only stable pages appear in lists.include
– 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[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
qualitypages | Controls the inclusion or exclusion of pages which are flagged as 'quality pages'. |
Syntax:
qualitypages=criteria
where criteria can be one of:
exclude
– Quality pages are excluded from listsonly
– Only quality pages appear in lists.include
– 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[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
skipthispage | Includes the page containing the DPL query in the result set (self reference, which is excluded by default). |
Syntax:
skipthispage=no
– (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).
Restrict the output (selection) volume[edit]
count[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
count | Controls the number of results shown. |
Syntax:
count=n
, where n 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:
$wgDplSettings['maxResultCount']
– Query result number maximum limit.$wgDplSettings['allowUnlimitedResults']
– Allow unlimited query results, which may result in slow or failed page loads.- A blank value (
count=
) sets results to unlimited, which may also result in slow or failed page loads.
- A blank value (
- 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
DPL_count
.
Example:
{{#lsth:Examples/Parameter: count (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
scroll[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
scroll | Enables built-in support for scrolling through large result sets, allowing them to be split into smaller result sets. |
Syntax:
scroll=yes
– (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 &DPL_fromTitle
and &DPL_toTitle
. Within the resultsheader
and/or resultsfooter
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
&DPL_fromTitle
and&DPL_toTitle
.- If these arguments are given, the commands
title>
andtitle<
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.
- If these arguments are given, the commands
scroll=yes
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 resultsheader and/or resultsfooter that generates links to fetch the next / previous page(s), though if such is used it is likely that
allowcachedresults=false
needs to be set.
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 execandexit
comes in, it stores the URL parameters in a variable which can be accessed via
#dplvar.
Example:
{{#lsth:Examples/Parameter: scroll (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Result:
{{#lsth:Examples/Parameter: scroll (example 1)|Result}}
Example:
{{#lsth:Examples/Parameter: scroll (example 2)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Result:
{{#lsth:Examples/Parameter: scroll (example 2)|Result}}
offset[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
offset | Shows only a portion of a big result list; typically used in combination with count. |
Syntax:
offset = n
where n is the number of result lines to skip, (integer) – (default = 0)
Example:
{{#lsth:Examples/Parameter: offset (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Result:
{{#lsth:Examples/Parameter: offset (example 1)|Result}}
Notes:
- A DPL query could be put into a template with
count
andoffset
parameters. Calling this template with different values would allow different portions of the result list to be displayed. - If
mode=ordered
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
DPL_offset
.
randomcount[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
randomcount | Selects a subset from the result set for display, based on a random count. |
Syntax:
randomcount=n
where n is a positive integer.
If randomcount is larger than the number of results, the complete result set is displayed.
Example:
{{#lsth:Examples/Parameter: randomcount (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Result:
{{#lsth:Examples/Parameter: randomcount (example 1)|Result}}
randomseed[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
randomseed | Sets an initial value for the random generator. |
Syntax:
randomseed=n
where n is a positive integer.
Example:
{{#lsth:Examples/Parameter: randomseed (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
distinct[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
distinct | Allows / suppresses duplicates in the output. |
Syntax:
distinct=critria
where criteria can be one of:
false
– A page can occur more than once in the output.strict
– A page can occur only once in the output if more than one page is specified forlinksto
orlinksfrom
, and the same page is referenced by more than one.true
– A page can occur only once in the output – (default, need not be specified)
Works in connection with linksto
and linksfrom
:
- A page can occur more than once in the output.
- This happens if more than one page is specified in
linksfrom=
orlinksto=
parameters, and the same page contains links to more than one of them (linksto), or if the same page is referenced by more than one of them (linksfrom). - To see a page only once also in these cases, use
distinct=strict
. - To see multiple result entries, set the value to
false
. This may make sense in combination withlinksto=
orlinksfrom=
to see how many links from one document to another document exist.
- This happens if more than one page is specified in
ignorecase[edit]
Page Template:DPL parameter/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
ignorecase | Makes comparisons insensitive to case. |
Syntax:
ignorecase=true
:
true
– Comparisons are case-insensitive (only true makes sense as an argument)false
– Comparisons are case-sensitive – (default, need not be specified)
The parameter has an effect on linksto
, uses
, titlematch
, titleregexp
and their not-equivalents.
Note: For case-insensitivity in ordering result sets, see ordercollation
.