Help:DPL/manual
DynamicPageList3 (DPL/DPL3) is a powerful MediaWiki extension that can generate lists of pages, and/or certain data and statistics gathered from them, for display in a wiki page. DPL lists are automatically updated whenever said data changes.
As a basic example, DPL can be used to insert, in a wiki page, an always-current list of all pages of a particular category. The data displayed may be selected and sorted based on factors like author, namespace, date, name pattern, usage of templates, or references to other articles, with a variety of custom formatting possibilities.
Usage[edit]
Primary DPL module[edit]
These sections contain documentation on DPL's primary module, {{#dpl: ... }}
. This is the DPL functionality used most often, and has a wide range of powerful options.
Other DPL modules[edit]
These sections detail some additional functions provided by the DPL extension.
- /dplchapter: {{#dplchapter: }}
- /dplvar: {{#dplvar: }}
- /dplreplace: {{#dplreplace: }}
- /dplnum: {{#dplnum: }}
- /dplmatrix: {{#dplmatrix: }}
Example wikicode[edit]
Selecting articles[edit]
- By category
{{#dpl: | category = Asura }}
- Recently changed articles
{{#dpl: | namespace = | addeditdate = true | ordermethod = lastedit | order = descending | count = 10 }}
Show article's context or contents[edit]
- Pages linked from an article
{{#dpl: | format = ,[[%PAGE%]],<br/> | ordermethod = none | linksfrom = Main Page }}
- Images used on an article
{{#dpl: | imagecontainer = Zojja | format = ,\n*[[%PAGE%]]\n, }}
Controlling output[edit]
- Show templates parameters from an article
{{#dpl: | title = Help:DPL/manual/page selection | include = {Help DPL manual parameter}:1:2 }}
- Show sections from an article
{{#dpl: | title = Unending Ocean | include = #Locations }}
Complete DPL Manual Table of Contents[edit]
Below is the legacy Table of Contents provided as navigation in the original DPL documentation. It is an expansive, cross-referenced list of DPL parameters (which some find daunting and others find helpful). Its links can all be found via the pages listed above, however the table below may be useful to more easily find what you need, especially if you don't know which section your desired functionality might be located in (expand the table below and use your browser's Find In Page feature, usually Ctrl-F
).
page | name | purpose |
---|---|---|
format | mode | Provide basic control over the output of DPL. |
format | inlinetext | To define the inline text used in mode=inline. |
format | listseparators | (alias for format) see the format parameter. Implicitly sets mode=userformat. |
format | format | customize the output format completely. Implicitly sets mode=userformat. Uses variable references like Help:DPL/manual/format to describe the output format. See also the secseparators parameter. |
format | secseparators | customize the output format of included sections. Can be used with standard output modes and with mode=userformat. |
format | multisecseparators | put a tag between multiple transcluded parts which refer to the same template or chapter. |
format | dominantsection | define a section with multiple occurrences as dominant, i.e. each piece of contents of this section (which is associated with a template call or a chapter within the original document) will create a separate output line. |
format | table | a simple syntax to create standard tabular output; see also tablerow |
format | tablerow | a simple syntax to create customized tabular output; see also table |
format | tablesortcol | define a column to be used as sort key (see also table ) |
format | headingmode | To control the output of the headings in a DPL with complex/multi-parameter ordermethod. (No effect with single-param ordermethods.) For ordermethod=method1,method2,..., method1 is used for headings. E.g. headingmode affects category headings in ordermethod=category,title (2-param ordermethod). See also headingcount |
format | headingcount | In combination with headingmode this parameter decides whether we show a text line with the number of articles per group or not. |
format | listattr | Adds attributes to HTML list elements, depending on mode (HTML element is ol for ordered, ul for unordered, div for others). Can be used with pseudo mode=inline where inline text contains one or more <br/>.
Only applicable to mode=ordered or mode=unordered. Not applicable to mode=category or mode=inline (with no <br/> in inline text). |
format | itemattr | Adds attributes to HTML list items, depending on mode (element is li for ordered/unordered, span for others).
Not applicable to mode=category. |
format | hlistattr | Adds attributes to the HTML list element at the heading/top level, depending on headingmode (HTML element would be ol for ordered, ul for unordered, dl for definition, div for others)
Not yet applicable to headingmode=none. |
format | hitemattr | Adds attributes to HTML list items (headings) at the heading level, depending on headingmode (HTML element would be li for ordered/unordered, div for others).
To be used with headingmode='unordered' or 'ordered'. (Not yet applicable for others.) |
format | userdateformat | Define a special layout for date formatting. |
format | shownamespace | To restrict the appearance of the namespace name of a page before the page. As the switch is true by default it should be set to false if you want to avoid namespaces to be shown in the output. |
format | escapelinks | Regarding images and categories this parameter allows you to decide whether
|
format | titlemaxlength | To limit the number of characters of the title to display. If the page title (this does not include the namespace or any other prefix before the title) is bigger than the titlemaxlength value, the title is truncated and ended by '...'. |
format | replaceintitle | execute a string replacement operation on the format var |
format | columns | Define a column layout for the output. |
format | rows | Define a row layout for the output. A "row" is a group of output lines for which the heading is repeated. If you do not know how big your result will be, it may be better to use the rowsize parameter. |
format | rowsize | Define a row layout for the output. A "row" is a group of n output lines for which the heading will be repeated. |
format | rowcolformat | Defines layout properties (using HTML table tag parameters) for the row/column grid. |
format | resultsheader | output a headline if there is at least one article to display. |
format | resultsfooter | output a summary 'footline' if there is at least one article to display. |
format | oneresultheader | output a headline if there is exactly one article to display. |
format | oneresultfooter | output a footline if there is exactly one article to display. |
format | noresultsheader | output a headline if there is no article to display (empty result). |
format | suppresserrors | suppress the warning message if no matching article was found. |
format | noresultsfooter | output a footline if there is no article to display (empty result). |
format | addcategories | Shows all categories to which an article belongs as a small text line after the article name. |
format | addpagecounter | Shows number of times the page has been viewed according to the definition of the 'page_counter' field on Page_table. |
format | addpagesize | Shows the size of the page. |
format | addcontribution | shows how much a user contributed to an article. |
format | adduser | Requires ordermethod=[...,]firstedit or ordermethod=[...,]lastedit (where the [...,] signifies a complex ordermethod with extra parameters). If firstedit (lastedit), 'adduser=true' displays the user who made the first (last) revision of the page. In this way the parameter is equivelent to the addauthor (addlasteditor) parameter (see below). |
format | addauthor | show the user who created the article |
format | addlasteditor | show the user who edited the most recent revision of a page |
format | addpagetoucheddate | Shows date/time of last change to the page according to the definition of the 'page_touched' field on Page_table.
Requires ordermethod=[...,]pagetouched or ordermethod=[...,]title. ([...,] means complex ordermethods with extra param before are allowed.) |
format | addeditdate | Requires ordermethod=[...,]firstedit or ordermethod=[...,]lastedit. ([...,] means complex ordermethods with extra param before firstedit |
format | addexternallink | add the URL of an external link to the output list. |
format | addfirstcategorydate | Shows the date/time the article got added to one of the listed include categories. If there are more than one categories listed and an article belongs to more than one of them, the result is ambiguous.
From a logical point of view it is recommended to include one category only with 'category' parameter or to make sure that each of the article in the result belongs to only one of the categories listed. Conflicts with other "add*date" (addeditdate, etc.) parameters to avoid confusion. |
format | showcurid | page links will contain the current page id |
format | include | include pages (whole content) or include certain sections of articles or template parameters.
This functionality is based on the ideas and work of Steve Sanbeg and his extension Labeled Section Transclusion. DPL comes with a modified version of Sanbeg´s source, so there is no need for additional installation. |
format | includepage | this can be used as a longer name for include. |
format | includemaxlength | Delimit the size of an included article to a maximum of [n] characters of wiki source text or less.
Care is taken to respect pairs of braces and brackets as far as possible. Otherwise we might confuse the result by half-cut syntax elements of transcluded sections. Therefore the output might be shorter or even larger than [n] characters. |
format | includetrim | removes all leading and trailing whitespace from transcluded contents. |
other parameters | allowcachedresults | Cache query results to improve performance keep servers from crashing under high load. |
other parameters | cacheperiod | define the expiration period for the dplcache |
other parameters | debug | Sets debugging level. |
other parameters | reset | suppress references to pages, templates, images, categories in DPL output |
other parameters | eliminate | suppress references to pages, templates, images, categories in DPL output |
other parameters | execandexit | process the command given as an argument and then exit immediately. |
page selection | category | Select articles based on categories. You can specify more than one category with the pipe as a separator, with the effect that the pages listed have to be at least in one of the categories (logical OR).
If you specify the 'category=' parameter more than once, the pages listed have to match all these parameters (logical AND). |
page selection | categorymatch | Select articles based on categories. You can specify one or more patterns (SQL LIKE); a page will be selected if at least one of its categories matches at least one of the patterns. |
page selection | categoryregexp | select pages with a category matching a regular expression |
page selection | notcategory | Much like the category parameter, but requires that every page listed not be in a particular category. Unlike in 'category' you cannot combine several categories using logical OR in this parameter. |
page selection | notcategorymatch | Works like notcategory but based on SQL LIKE |
page selection | notcategoryregexp | Works like notcategory but based on SQL REGEXP |
page selection | categoriesminmax | To restrict the search to articles which are assigned to at least [min] and at most to [max] categories. |
page selection | namespace | To restrict the articles in the list to only be in one of the given namespaces. |
page selection | notnamespace | Much like the notcategory parameter, but for namespaces. Requires that every page listed not be in one of given namespaces. |
page selection | linksfrom | Selects articles which are referenced from at least one of the specified pages. |
page selection | openreferences | extends the 'linksfrom' to unresolved references. |
page selection | notlinksfrom | Selects articles which are NOT referenced from any of the specified pages. |
page selection | linksto | Selects articles which link to at least one of the specified pages. |
page selection | notlinksto | Selects articles which do NOT link to any of the specified pages. |
page selection | linkstoexternal | Selects articles which contain an external link that matches a given text pattern. |
page selection | imageused | Selects articles which use a certain image |
page selection | imagecontainer | Select images which are contained in one or more articles |
page selection | uses | Selects articles which use (transclude) at least one of the specified templates (wiki syntax: {{...}} ).
|
page selection | notuses | Selects articles which do not use any of the specified template. |
page selection | usedby | Selects articles (templates) which are used (included) by a specified page. |
page selection | createdby | [SLOW] Selects articles which were created by the specified user. |
page selection | notcreatedby | [SLOW] Selects articles which were NOT created by the specified user. |
page selection | modifiedby | Selects articles which were created or at least once modified by the specified user. |
page selection | notmodifiedby | Selects articles which were NOT (created or) modified by the specified user. |
page selection | lastmodifiedby | Selects articles where the last modification was done by the specified user. |
page selection | notlastmodifiedby | Selects articles where the last modification was NOT done by the specified user. |
page selection | title | Select one single page by its (namespace and) title. |
page selection | titlelt | Restrict the selection to pages with a title less or equal to a given value. |
page selection | titlegt | Restrict the selection to pages with a title greater or equal to a given value. |
page selection | scroll | enable built-in support for scrolling result sets. |
page selection | titlematch | Select pages 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.
|
page selection | titleregexp | Select pages with a title matching the specified regular expressions. The pattern will be used as a REGEXP argument in a SQL query. Namespaces are ignored as the namespace= parameter can be used to further narrow the selection. |
page selection | nottitlematch | Select pages 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. |
page selection | nottitleregexp | Select pages with a title that does NOT match the specified regular expression. The expression will be used as a REGEXP 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. |
page selection | includematch | Controls the selection of pages based on contents which shall be included from these pages. |
page selection | includematchparsed | Controls the selection of pages based on (pre-parsed) contents which shall be included from these pages. |
page selection | includenotmatch | Controls the selection of pages based on contents which shall be included from these pages. |
page selection | includenotmatchparsed | Controls the selection of pages based on (pre-parsed) contents which shall be included from these pages. |
page selection | lastrevisionbefore | shows only articles which existed before the specified date. The date of the last revision
before that date will be shown (and will be available as 0 in mode=userformat). |
page selection | firstrevisionsince | The date of the first revision after the specified date will be shown (and will be available as 0 in mode=userformat). |
page selection | allrevisionsbefore | shows all revisions which existed before the specified date. The date of each revision will be shown (and will be available as 0 in mode=userformat). |
page selection | allrevisionssince | shows all revisions which were created after the specified date. The date of each revision will be shown (and will be available as 0 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. |
page selection | maxrevisions | show a page (or its revisions) only if there do not exist more than a given number of revisions for that page. |
page selection | minrevisions | show a page (or its revisions) only if there exist at least a given number of revisions for that page. |
page selection | articlecategory | select a talk page based on a category to which the corresponding base article (in the default namespace) belongs. |
page selection | includesubpages | Controls the inclusion or exclusion of pages which have a '/' in their name. Default is true .
|
page selection | redirects | Controls the inclusion or exclusion of redirect pages in the output. By default redirections are NOT shown. |
page selection | minoredits | Control the inclusion or exlusion of minor edits in lists. |
page selection | stablepages | Control the inclusion or exclusion of pages which are flagged as 'stable' |
page selection | qualitypages | Control the inclusion or exclusion of pages which are flagged as 'quality pages' |
page selection | skipthispage | include the page containing the DPL query into the result set |
page selection | count | Controls the number of results that are shown. |
page selection | scroll | activate result scrolling |
page selection | offset | show only a portion of a big result list; typically used in combination with "count=" |
page selection | randomcount | create the complete result set and then select a subset for display by random. |
page selection | randomseed | set an initial value for the random generator |
page selection | distinct | allow / suppresses duplicates in the output |
page selection | ignorecase | make comparisons insensitive to case |
sorting | ordermethod | Determines what criterion (resp. criteria) is (resp. are) used to order the list. |
sorting | order | Controls the sort direction of the list. |
sorting | ordercollation | Allow individual collations, make case insensitive sorting possible |