Help:DPL
From The Scuba Wiki
MediaWiki Handbook: Contents, Readers, Editors, Moderators, System admins +/- |
Contents |
Flavours
Two versions of dynamic page lists (DPL) exist, an older variant using tags <dynamicpagelist> plus </dynamicpagelist>, and an advanced 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.
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
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
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 counts=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
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
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
With addfirstcategorydate=true the date of the addition to the first category is shown.
Example
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:
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:
2010-01-02: Template:H:h
2010-01-02: Template:H:htest
2010-01-02: Template:H:h Template
2009-12-28: Help:Contents
2009-12-28: Help:Editor
2009-12-28: Template:Wikilink syntax tbl
2009-12-28: Template:Ph:Contents/pt-br
2009-12-28: Help:Contents/pt-br
2009-12-28: Template:Xpdn
2009-12-28: Template:Ph:Reader
2009-12-28: Template:H:Local time variables
2009-12-28: Template:H:Page name variables
2009-12-28: Template:H:Current time variables
2009-12-28: Template:H:
2009-12-28: Template:System admin toc
2009-12-28: Template:Moderator toc
2009-12-28: Template:Reader toc
2009-12-28: Template:Editor toc
2009-12-28: Template:Ph:Page for demos in the Help namespace
2009-12-28: Template:H-langs:
2009-12-28: Template:H:l
2009-12-28: Help:Template/onlyinclude demo
2009-12-28: Template:Ph:MediaWiki help policy
2009-12-28: Template:Unclear
2009-12-28: Template:Modifier
2009-12-28: Template:H:f Помощь
2009-12-28: Template:H:f ヘルプ
2009-12-28: Template:Modif
2009-12-28: Template:H:f Ndihmë
2009-12-28: Template:H:f Hilfe
2009-12-28: Template:H:f Hjelp
2009-12-28: Template:H:f NL Help
2009-12-28: Template:H:f Aiuto
2009-12-28: Template:H:f Aide
2009-12-28: Template:Ed
2009-12-28: Template:Edde
2009-12-28: Template:Edhf
2009-12-28: Template:Ph:CheckUser
2009-12-28: Template:Ill
2009-12-28: Template:H:mwg
2009-12-28: Template:H:f Help
2009-12-28: Template:Edi
Meta currently supports only the simple DPL.
Links to other help pages
- Help contents
- Meta | Wikinews | Wikipedia | Wikiquote | Wiktionary | commons: | mw: | b: | s: | mw:Manual | google
- Versions of this help page (for other languages see below)
- Meta | Wikinews | Wikipedia | Wikiquote | Wiktionary
- What links here on Meta or from Meta | Wikipedia | MediaWiki
- Reading
- Go | Search | Stop words | URL | Namespace | Page name | Section
- Backlinks | Link | Piped link | Interwiki link | Redirect | Category | Image page
- Logging in and preferences
- Logging in | Preferences | User style
- Editing
- Advanced editing | Editing FAQ | Edit toolbar | Export | Import | Shortcuts
- Tracking changes
- Recent changes (enhanced) | Related changes | Watching pages | Diff
- Page history | Edit summary | User contributions | Minor edit | Patrolled edit
- Style & formatting
- Wikitext examples | Reference card | HTML in wikitext | List | Table | Sorting | Colors
- Special input and output
- Inputbox | Special characters | Displaying a formula | Images (uploads) | EasyTimeline
- Advanced functioning
- Template | Advanced templates | Parser function | ParserFunctions | Parameter default
- Variable | Magic word | System message | Substitution | Array | Calculation
- Page management
- Starting a new page | Renaming (moving) a page | Protecting pages | Deleting a page
- Special pages
- Talk page | Testing | Sandbox | CentralNotice