Help:DPL

From Meta, a Wikimedia project coordination wiki
Jump to: navigation, search
MediaWiki Handbook: Contents, Readers, Editors, Moderators, System admins, Researchers +/-

DynamicPageList or DPL for short is a MediaWiki extension supporting intersections and other set operations of pages belonging to several categories.

Flavours[edit]

Two versions of dynamic page lists (DPL) exist, a variant using the tags <dynamicpagelist> plus </dynamicpagelist>, and another variant using tags <dpl> plus </dpl>. A project can support none, one, or both of these two extensions, see "parser extension tags" in Special:Version. <dynamicpagelist> is the only variant supported on Wikimedia projects, and only on smaller projects.

The advanced version covers all functions of the older variant, here only the latter is explained. For further details see the descriptions in DynamicPageList and DynamicPageList2.

Operation[edit]

In essence categories are sets of related pages, created by adding [[Category:common property]] to the individual pages. In addition category pages are also ordinary pages in their first part with all features of normal pages, but their main purpose is to list all pages belonging to the category. This changes as soon as [[Category:common property]] is added or removed from one or more of the individual pages, the members of this set.

Watching the category page only tracks modifications to its first part (as for any ordinary page), but it doesn't show any additions or removals of member pages. DPLs address this missing feature, they also allow to sort member pages by various criteria where categories only offer a crude sort key or alphabetical order.

Simple DPLs start with <dynamicpagelist> followed by one or more category=name and optionally other parameter=value pairs, and they are terminated by </dynamicpagelist>. For a similar construct see inputbox.

One (first) category=name is required, and it's the base for some other attributes. Adding more category=name restricts the DPL to pages in the intersection of all specified categories.

With notcategory=name pages in that category are removed from the DPL. So for categories A, B, and C use category=A and category=B with notcategory=C for all pages in both A and B, but not C. And also not only in A, and not only in B.

Two DPLs could be used to get a kind of union, the first DPL for category A, and the second DPL for category B without A, but real unions require the advanced DPL features.

Restrictions[edit]

The attribute namespace= allows to restrict listed pages to a namespace given by its number or name. Use 0 for the main namespace.

The attribute redirects= can be exclude (default) not listing any redirects belonging to the selected categories. With include redirects are listed, and redirects=only limits the DPL to only redirects.

With count=n the DPL is limited to the first n member pages as determined by the sort order (see below). The default is a system-wide maximum, with two DPLs looking at the same set from both ends it's indirectly possible to determine if really all selected pages are shown (see below).

Output[edit]

Use suppresserrors=true to suppress error messages for an empty DPL, e.g. if the selected category doesn't exist.

The default output mode=unordered presents the DPL as unordered list, XHTML <ul>, like Wiki list markup *.

Similarly ordered results in numbered <ol> output like Wiki list markup #. Finally mode=none presents the DPL with one entry per line, terminated with <br />, roughly similar to Wiki list markup ; (semicolon).

Especially in conjunction with namespace= the attribute shownamespace=false allows to suppress the output of the namespace.

Sorting[edit]

DPLs are either sorted by the date of the addition to the first category (this is often not the date of the creation of the individual page), the default ordermethod=categoryadd, or by ordermethod=lastedit, the date of the last modification of the member pages.

Sorting can be order=descending (default, most recent first) or order=ascending, allowing to look at the same set from both ends in two DPLs (see above).

Dates[edit]

With addfirstcategorydate=true the date of the addition to the first category is shown.

Example[edit]

If the following example doesn't work where you read this page look at it on Meta.

<dynamicpagelist>
category=Reader handbook
order=ascending
ordermethod=lastedit
mode=ordered
shownamespace=false
</dynamicpagelist>

This results in a numbered list of help pages, oldest first:

  1. Project
  2. Redirect/expr
  3. Image page
  4. Printable
  5. Date formatting and linking
  6. Redirect
  7. Enhanced recent changes
  8. Diff
  9. Self link
  10. Downloading pages
  11. Nemo bis/importing
  12. What links here
  13. Page history
  14. Logging in
  15. Handbook guidelines
  16. User contributions
  17. Searching
  18. Related changes
  19. Linksearch
  20. Category
  21. Go button
  22. Tracking changes
  23. Page name
  24. Preferences
  25. Contents/ar
  26. Special page
  27. Recent changes/de
  28. Recent changes/tr
  29. Recent changes
  30. Recent changes/it
  31. Recent changes/el
  32. Recent changes/ru
  33. Recent changes/ca
  34. Recent changes/gl
  35. Recent changes/fr
  36. Recent changes/hi
  37. Recent changes/ka
  38. Recent changes/ja
  39. Recent changes/ps
  40. Recent changes/sq
  41. Recent changes/lt
  42. Recent changes/eu
  43. Recent changes/zh
  44. Recent changes/pt-br
  45. Recent changes/bs
  46. Recent changes/en
  47. Recent changes/lb
  48. Recent changes/as
  49. Recent changes/pt
  50. Recent changes/cs
  51. Recent changes/es
  52. Recent changes/pl


Another example:

<dynamicpagelist>
category=Handbook templates
notcategory=Templates using ParserFunctions
mode=none
addfirstcategorydate=true
</dynamicpagelist>

This creates a plain list with the dates of the addition to the first (here only) category:


16 June 2015: Template:Fdnw
16 June 2015: Template:Fd
16 June 2015: Template:H:h Help
4 April 2015: Template:H:f Help
10 March 2015: Template:MediaWiki links/ar
9 March 2015: Template:MediaWiki links/tr
6 March 2015: Template:MediaWiki links ms
4 March 2015: Template:मिडियाविकि दूवे
29 January 2015: Template:Ph:Contents/pt-br
29 January 2015: Template:Ediu
29 January 2015: Template:Xpdn
29 January 2015: Template:Edi
4 January 2015: Template:Reader toc/uk
3 January 2015: Template:H:f Help/uk
1 June 2014: Template:Unclear
26 November 2013: Template:Reader toc/sq
26 November 2013: Template:Reader toc/ar
26 November 2013: Template:Moderator toc/ru
26 November 2013: Template:Editor toc/ru
26 November 2013: Template:System admin toc/ru
26 November 2013: Template:Reader toc/ru
23 August 2013: Template:Moderator toc/zh-hant
23 August 2013: Template:Reader toc/zh-hant
12 March 2013: Template:Reader toc/de
12 March 2013: Template:Editor toc/de
29 August 2012: Template:Ph:CheckUser
20 May 2012: Template:System admin toc/zh-hant
20 May 2012: Template:Redaktuesi toc
20 May 2012: Template:Reader toc el
20 May 2012: Template:Ph:Page for demos in the Help namespace
20 May 2012: Template:MediaWiki връзки
20 May 2012: Template:MediaWiki nyje
20 May 2012: Template:MediaWiki linky
20 May 2012: Template:MediaWiki links/zh-hant
20 May 2012: Template:Editor toc/zh-hant
20 May 2012: User:AaronPeterson/css play
21 April 2012: Template:Modifier
21 April 2012: Template:Modif
21 April 2012: Template:Edde
21 April 2012: Template:EdML
21 April 2012: Template:H:h Help/no
21 April 2012: Template:H:h Help/nl
21 April 2012: Template:H:h Help/fr
21 April 2012: Template:H:f Help/zh-hant
21 April 2012: Template:H:f Help/vi
21 April 2012: Template:H:f Help/sq
21 April 2012: Template:H:f Help/no
21 April 2012: Template:H:f Help/nl
21 April 2012: Template:H:f Help/ja
21 April 2012: Template:H:f Help/it
21 April 2012: Template:H:f Help/fr
21 April 2012: Template:H:f Help/ar
21 April 2012: Template:H:f Help/de
20 April 2012: Template:System admin toc/zh
20 April 2012: Template:Reader toc ja
20 April 2012: Template:Reader toc/zh
20 April 2012: Template:Povezave za MediaWiki
20 April 2012: Template:Moderator toc/zh
20 April 2012: Template:MediaWiki links/Ru
20 April 2012: Template:Lezer inhoud
20 April 2012: Template:Kazalo za skrbnike
20 April 2012: Template:Editor toc pt
20 April 2012: Template:Amministratori toc
9 March 2012: Template:Moderator toc
9 March 2012: Template:Reader toc
5 February 2012: Template:-
16 June 2011: Template:MediaWiki links
25 April 2011: Template:H:mwg
25 April 2011: Template:Ed
9 April 2011: Template:Ill
27 March 2011: Template:Editor toc
15 February 2011: Template:Ph:MediaWiki help policy
19 December 2007: Template:Wikilink syntax tbl
9 June 2007: Help talk:Template/onlyinclude demo
9 June 2007: Help:Template/onlyinclude demo
9 June 2007: Template:H:htest
9 June 2007: Template:H:h Template
15 February 2007: Template:Timd
8 February 2007: Template:H:Language-dependent variables
8 February 2007: Template:H:Miscellaneous variables
8 February 2007: Template:H:Position variables
8 February 2007: Template:H:Size variables
8 February 2007: Template:H:Modifier variables
8 February 2007: Template:H:Formatting variables
8 February 2007: Template:H:Namespace variables
8 February 2007: Template:H:Statistics variables
8 February 2007: Template:H:Section variables
8 February 2007: Template:H:Page name variables
31 August 2006: Template:Ph:Vsebina
17 June 2006: Template:H:f Template
25 May 2006: Template:Edhf
29 April 2006: Template:H-langs:
22 April 2006: Template:H:l
22 April 2006: Template:H:
22 April 2006: Template:System admin toc