Wikinews:DynamicPageList

MediaWiki wiki has a page about this at: Extension:DynamicPageList (Wikimedia)

DynamicPageList (DPL) is a Mediawiki extension developed for use on Wikinews (see e.g. 2006/August/14), but can be installed on any wiki. Its name was officially changed to the Intersection extension to avoid confusion with a similar but different DynamicPageList extension. However, it is still generally referred to as DynamicPageList. It works also on Meta, Wikibooks, and several other wikimedia wikis (not wikipedia). It allows wiki users to create a list of pages that are listed in a set of categories. An enhanced versions of the extension has been developed, mw:Extension:DynamicPageList (third-party), but it is not yet available on Wikinews, and is unlikely to be any time soon (however it is super-awesome!).

The dynamic page list is in Git at. To install it, put the file in your  directory, and add   to your LocalSettings.php file.

Using DynamicPageList
The Dynamic Page List (DPL) is a Manual:Extensions. To use it, use the following XML-like syntax on your wiki page:

 ...parameters... 

The output of this would be something like:


 * Page 1
 * Page 2

where the list of pages being output, as well as the order and display mode of the list are set by the parameters specified.

The following lists parameters and their effects

category
Purpose:

DPL produces a list of all pages in the intersection of the specified categories (the pages which are in all of the listed categories).

Syntax:

Example:

 category=Africa category=Politics and conflicts 

This list will output pages that have both the and  listed.

Notes:

At least one category parameter is required. There is a maximum number of category parameters allowed by the extension, configurable at installation time (see top of the extension file). You may use any magic word (variable) like July, 29, 2024, etc in the category names. You can even use templates if you wish. Even templates with parameters. (For example, see Portal:Random). However, if you want to make a transcludable DPL with parameters (aka ), you must use   syntax.

notcategory
Purpose:

Restricts the list of pages specified above to those not in a particular category.

Syntax:

Example:

 category=Africa notcategory=Zimbabwe 

This list will output pages that have but do not have  listed.

Notes: You may use magic words like July, 29, 2024 etc in the category name.

namespace
Purpose:

Restricts the list of pages specified above to those in a particular namespace.

Syntax:

The namespaceid may be any positive integer or zero, assuming it represents a valid namespace in the system. The zero namespace is the main article namespace.

Instead of the number, you may also specify a name, for example Talk or Template or User_talk. Any invalid name is equivalent to the main article namespace.

Example:

 category=Policy namespace=Wikinews 

This list will output pages that are in the Wikinews namespace and belong to.

redirects
Purpose:

Controls the inclusion or exclusion of redirect pages in lists.

Example:

criteria can be one of:
 * exclude &mdash; excludes redirect pages from lists &mdash; (default)
 * include &mdash; allows redirect pages to appear in lists
 * only &mdash; lists only redirect pages in lists

Example:

 category=Africa redirects=include 

This list will content pages and redirect pages tagged with.

count
Purpose:

Restricts the number of results that are shown.

Example:

Example:

 category=Africa count=2 

This list will output the two most recent pages that have.

Notes:

There is a maximum allowed number of results, controlled by a setting in the extension.

shownamespace
Purpose:

Specify whether to display the namespace names of the pages (default=true).

With the code

instead of e.g. Template:Stub the listing would simply be Stub.

Example:

 category=Africa namespace=Talk shownamespace=false 

This list will output all Talk pages in, listed without the Talk: prepended to page names.

addfirstcategorydate
Purpose:

Shows the date the article got added to the first listed include category.

Example:

If omitted, the default is false.

Example:

 category=Kenya category=Tanzania addfirstcategorydate=true 

gives:

<DynamicPageList> category=Kenya category=Tanzania addfirstcategorydate=true </DynamicPageList> (apparently the lower bound is 2 July 2005)

This list will output a list of pages belonging to, prepending each result with "DD Month YYYY: " (formatted according to your local mediawiki date display preferences).

mode
Purpose:

To control the output of the DPL: with bullets, numbers, or nothing in front.

Syntax:

modename can be one of:
 * unordered &mdash; outputs an unordered list &mdash; HTML tag "ul" &mdash; (default)
 * ordered &mdash; outputs an ordered list &mdash; HTML tag "ol"
 * none &mdash; outputs a list using newlines and HTML tags "br" to separate each item

Example:

<DynamicPageList> category=Africa mode=ordered </DynamicPageList>

This list will output pages that have shown in an &lt;ol&gt;...&lt;/ol&gt; list.

suppresserrors
Purpose:

Allows warnings about empty lists to be suppressed.

Example:

If omitted, the default is false.

Example:

<DynamicPageList> category=Nonexistent suppresserrors=true </DynamicPageList>

This list will output no pages since the category is non-existent, but will not show a warning saying the list is empty.

Error messages are controllable via:
 * mediawiki:intersection_noincludecats
 * mediawiki:intersection_toofewcats
 * mediawiki:intersection_toomanycats
 * mediawiki:intersection_noresults

Originally this parameter was used very heavily throughout Wikinews, as the error message for no articles was very cryptic and ugly. Now we have changed the error message to be more friendly, so the use of this paramter is not as important anymore. Nonetheless, it is still commonly used.

showcurid
Purpose:

Link includes unique page id (needed for some web spiders, links directly to a page even if it moved titles, or the title specified is incorrect ). This is specifically used by the google news spider, which needs a unique identifier for each page in the url. This does not change appearance, just the link url.

Example:

If omitted, the default is false.

Example:

<DynamicPageList> category=Published showcurid=true </DynamicPageList>

Example:

If Post-probe, problematic peanut paste products pulled was on the page list. Without the parameter, it would link to http://en.wikinews.org/wiki/Post-probe,_problematic_peanut_paste_products_pulled. However, with the parameter it links to http://en.wikinews.org/wiki/Post-probe,_problematic_peanut_paste_products_pulled?curid=120194.

googlehack
Like curid, except uses the parameter dpl_id instead of curid. Curid sometimes triggers the no robots flag.

FlaggedRevisions
Purpose to control inclusion of pages marked sighted/stable/quality

stablepages
filter can be:
 * exclude &mdash; excludes stable pages from lists &mdash; (default if invalid argument given)
 * include &mdash; allows stable pages to appear in lists (default)
 * only &mdash; lists only stable pages in lists

qualitypages
filter can be:
 * exclude &mdash; excludes quality pages from lists &mdash; (default if invalid argument given)
 * include &mdash; allows quality pages to appear in lists (default)
 * only &mdash; lists only quality pages in lists

ordermethod
Purpose:

Determines what date is used for ordering the list.

method can be one of:
 * categoryadd &mdash; outputs list based on most recent addition to the first category &mdash; (default)
 * lastedit &mdash; outputs list based on most recent edit to the pages

Example:

<DynamicPageList> category=Africa ordermethod=lastedit addfirstcategorydate=true count=3 </DynamicPageList>

gives

<DynamicPageList> category=Africa ordermethod=lastedit addfirstcategorydate=true count=3 </DynamicPageList> Note that sorting order is by last edit (or, in the case of a category, apparently by last edit of a page in that category), with most recently edited pages at the top, while the display date is that of addition to the category Africa.

whereas

<DynamicPageList> category=Africa ordermethod=addcategory addfirstcategorydate=true count=3 </DynamicPageList>

gives

<DynamicPageList> category=Africa ordermethod=addcategory addfirstcategorydate=true count=3 </DynamicPageList>

order
Purpose:

Controls the sort direction of the list.

Example:

orderdirection can be one of:
 * descending &mdash; outputs list from most recent to least recent &mdash; (default)
 * ascending &mdash; outputs list from least recent to most recent

Example:

<DynamicPageList> category=Africa order=ascending </DynamicPageList>

This list will output pages that have shown ordered from oldest to newest.