Jump to content

Extension:DynamicPageList (third-party): Difference between revisions

From mediawiki.org
Content deleted Content added
Order
Please use DynamicPageList3 instead
Tags: Replaced Disambiguation links
 
Line 1: Line 1:
{{Archived extension|6274994|DynamicPageList|DynamicPageList3|task=T353927}}
<languages/>
{{Note|1=<translate><!--T:1--> This is a third-party extension, not to be confused with the <tvar name=1>{{ll|Extension:DynamicPageList (Wikimedia)|DynamicPageList}}</tvar> used on Wikimedia sites or <tvar name=2>{{ll|Extension:DynamicPageList3}}</tvar>.</translate>
|2=reminder
}}
{{archival requested|T353927}}
{{Incompatible|version=1.35|alternative={{ll|Extension:DynamicPageList3}}}}
{{Extension
|name = DynamicPageList (third party)
|status = unmaintained
|type1 = tag
|type2 = parser function
|author = * [[w:User:IlyaHaykinson|IlyaHaykinson]],
* [[w:de:Benutzer:Unendlich~dewiki|Unendlich~dewiki]],
* [[meta:User:Dangerman|Dangerville]],
* '''[[User:Algorithmix|Algorithmix]]''',
* [[User:Theaitetos|Theaitetos]]
|image =
|version = Continuous updates
|update =
|mediawiki = '''<big>1.32.x - 1.34.x only</big>'''
|download = {{WikimediaDownload|DynamicPageList|phab=EDPL}}
|needs-updatephp = No
|readme =
|changelog =
|description = <translate><!--T:2--> Allows to '''create lists''' of other articles based on their ''category, namespace, title, references'' or ''template usage'' and '''include contents''' or arguments of template calls of those articles into your page.</translate>
|parameters= <translate><!--T:3--> see description</translate>
|license = GPL-2.0-or-later
|rights =
|phabricator = dynamicpagelist_third-party
|example = [https://followthescore.org/dpldemo/index.php/Extension_DPL various sample reports]
}}
<translate><!--T:4--> The <tvar name=1>'''DynamicPageList (third-party)'''</tvar> extension is a reporting tool for MediaWiki, listing category members and intersections with various formats and details.</translate>
<translate><!--T:5--> For full documentation, see the [<tvar name=url>https://followthescore.org/dpldemo/index.php?title=Extension_DPL</tvar> full original manual] or [<tvar name=url2>https://web.archive.org/web/20161105221036/http://semeb.com/dpldemo/DPL:Manual</tvar> manual] (German Manual <tvar name=1>[http://www.wiki-aventurica.de/wiki/Hilfe:Dynamic_Page_List Hilfe:DynamicPageList]</tvar>).</translate>

<translate><!--T:6--> In its most basic form, DPL displays a list of pages in one or more categories.</translate>
<translate><!--T:7--> Selections may also be based on factors such as author, namespace, date, name pattern, usage of templates or references to other articles.</translate>
<translate><!--T:8--> Output takes a variety of forms, some of which incorporate elements of selected articles.</translate>

<translate><!--T:9--> This extension is invoked with the parser function <tvar name=1><code>{{#dpl: .... }}</code></tvar> or parser tag <tvar name=2>{{tag|DPL|open}}</tvar>.</translate>
<translate><!--T:32--> A [[<tvar name=1>Special:MyLanguage/Extension:DynamicPageList (Wikimedia)</tvar>|Wikimedia]]-compatible implementation of certain features can be invoked with <tvar name="2">{{tag|DynamicPageList|open}}</tvar>.</translate>

<translate><!--T:33--> DPL can result in computationally-expensive database queries.</translate>
<translate><!--T:34--> For best performance, use the optional parameters <tvar name=1>[https://followthescore.org/dpldemo/index.php?title=DPL:Manual_-_DPL_parameters:_Other_parameters#allowcachedresults allowcachedresults]</tvar> and/or <tvar name=2>[https://followthescore.org/dpldemo/index.php?title=DPL:Manual_-_DPL_parameters:_Other_parameters#dplcache dplcache]</tvar> where possible.</translate>

<translate>
== Installation == <!--T:10-->
</translate>
{{Note|1=LocalSettings.php must '''not''' include [[Extension:Intersection|Wikimedia's version of DPL]] (Intersection).}}

{{ExtensionInstall
|DynamicPageList
|repo-name=DynamicPageList
|custom-steps=* <translate><!--T:11--> [[<tvar name=1>#Configuration</tvar>|Configure as required]] if necessary</translate>
}}

{{note|1=<translate><!--T:35--> During the installation process a template is automatically created.</translate> <translate><!--T:36--> If you are getting error messages about how user in the "users" group does not have permissions, it probably has something to do with the installer "user" does not have permission to create a template.</translate> <translate><!--T:37--> In order to install the extension, you may need to temporarily open up page creation permissions and then turn them off after the extension is installed.</translate>}}

<translate>
== Configuration == <!--T:12-->
</translate>
<translate><!--T:38--> DPL configuration settings and their default values, '''[<tvar name="url">https://followthescore.org/dpldemo/index.php?title=DPL:Manual_-_Source_and_Installation#Server-Wide_Configuration:_Extension_options</tvar> from the manual]''':</translate><!--We may as well try to keep these in alphabetical order-->

{|class = "wikitable"
! <translate><!--T:13--> Setting</translate>
! <translate><!--T:14--> Default</translate>
! <translate><!--T:15--> Description</translate>
|-
|<code>ExtDynamicPageList::$allowedNamespaces</code> || <code>null</code>
| <translate><!--T:39--> To be initialized at first use of DPL, array of all namespaces except Media and Special, because we cannot use the DB for these to generate dynamic page lists.</translate> <translate><!--T:40--> Cannot be customized.</translate> <translate><!--T:41--> Use <tvar name="1">{{phpi|ExtDynamicPageList::$options['namespace']}}</tvar> or <tvar name="2">{{phpi|ExtDynamicPageList::$options['notnamespace']}}</tvar> for customization.</translate>
|-
|<code>ExtDynamicPageList::$allowUnlimitedCategories</code> || <code>true</code> || <translate><!--T:42--> Allow unlimited categories in the Query</translate>
|-
|<code>ExtDynamicPageList::$allowUnlimitedResults</code> || <code>false</code> || <translate><!--T:43--> Allow unlimited results to be shown</translate>
|-
|<code>ExtDynamicPageList::$behavingLikeIntersection</code> || <code>false</code> || <translate><!--T:48--> Changes certain default values to comply with <tvar name="1">Extension:Intersection</tvar></translate>
|-
|<code>ExtDynamicPageList::$categoryStyleListCutoff</code> || 6
| <translate><!--T:44--> Max length to format a list of articles chunked by letter as bullet list, if list bigger, columnar format user (same as cutoff arg for <tvar name="1">{{phpi|CategoryPage::formatList()}}</tvar>)</translate>
|-
|<code>ExtDynamicPageList::$fixedCategories</code> || <code>empty array</code> || An array which holds categories to which the page containing the DPL query shall be assigned although reset_all|categories has been used
|-
|<code>ExtDynamicPageList::$functionalRichness</code> || 0
| <translate><!--T:49--> The amount of functionality of DPL that is accesible for the user; to be set by <tvar name="1">DynamicPageList.php</tvar> and <tvar name="2">DynamicPageListMigration.php</tvar> see the fixcategory command</translate>
|-
|<code>ExtDynamicPageList::$maxCategoryCount</code> || 4 || <translate><!--T:45--> Maximum number of categories allowed in the Query</translate>
|-
|<code>ExtDynamicPageList::$maxResultCount</code> || 500 || <translate><!--T:46--> Maximum number of results to allow</translate>
|-
|<code>ExtDynamicPageList::$minCategoryCount</code> || 0 || <translate><!--T:47--> Minimum number of categories needed in the Query</translate>
|-
|<code>ExtDynamicPageList::$options</code> || ''no options'' || <translate><!--T:50--> If you add a line like the following to your LocalSettings.php, DPL will only run from protected pages: <tvar name="1"><code>ExtDynamicPageList::$options['RunFromProtectedPagesOnly'] = "<small><i>Extension DPL (warning): current configuration allows execution from protected pages only.</i></small>";</code></tvar>.</translate> There is a whole bunch of other options too; see [https://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/DynamicPageList/DPLSetup.php?view=markup DPLSetup.php].
|-
|<code>ExtDynamicPageList::$respectParserCache</code> || <code>false</code> for &lt;dpl&gt; but <code>true</code> for &lt;DynamicPageList&gt;. || If set to 'true' DPL will no longer behave dynamically because its output is taken from the ParserCache. In other words, false = make page dynamic ; true = execute only when parser cache is refreshed
|-
|}

<translate><!--T:51--> These are all public static variables.</translate>

<translate><!--T:52--> The global variable <tvar name="1">{{manual|$wgNonincludableNamespaces}}</tvar> is also respected by DPL.</translate>
<translate><!--T:53--> It will prevent the contents of the listed namespaces from appearing in DPL's output.</translate>

{{note|1=<code>$maxResultCount</code> is a LIMIT ''on the SQL query itself''. Some DPL query parameters like <code>includematch</code> are applied ''after'' the SQL query, however, so results here may easily be misleading.}}

<translate>
=== Functional richness === <!--T:16-->
</translate>
<translate><!--T:54--> <tvar name="1">DynamicPageList</tvar> has many features; some are expensive, or dangerous in the wrong hands.</translate>
<translate><!--T:55--> It is important to choose an appropriate level of functionality for your wiki.</translate>

* <code>ExtDynamicPageList::setFunctionalRichness(0)</code> - <translate><!--T:62--> equivalent to Wikimedia's DPL</translate>
* <code>ExtDynamicPageList::setFunctionalRichness(1)</code> - <translate><!--T:56--> adds additional formatting parameters</translate>
* <code>ExtDynamicPageList::setFunctionalRichness(2)</code> - <translate><!--T:57--> adds performance equivalent features for templates and pagelinks</translate>
* <code>ExtDynamicPageList::setFunctionalRichness(3)</code> - allows more-expensive page inclusion features and regular expression queries; expect to use the [https://followthescore.org/dpldemo/index.php?title=DPL:Manual_-_DPL_parameters:_Other_parameters#dplcache dplcache] parameter
* <code>ExtDynamicPageList::setFunctionalRichness(4)</code> - <translate><!--T:58--> permits exotic and potentially dangerous batch update and delete operations; not recommended for public websites</translate>

{{Note|1=The Functional Richness grouping described above is a built-in suggestion; it can easily be adapted to your own preferences within "DPLSetup.php".}}

<translate>
== Usage == <!--T:17-->

===Extended DPL functionality=== <!--T:18-->

<!--T:59-->
DPL is invoked by using the parser function <tvar name="1"><code>{{#dpl: .... }}</code></tvar>, or the parser extension tag <tvar name="2">{{tag|DPL}}</tvar>.
</translate>

:''<translate><!--T:63--> See:</translate> [https://followthescore.org/dpldemo/index.php?title=DPL:Manual_-_General_Usage_and_Invocation_Syntax Manual - General Usage and Invocation Syntax] and [https://followthescore.org/dpldemo/index.php?title=DPL:Manual_-_DPL_parameters:_Criteria_for_page_selection Manual - '''DPL parameters''']''

<translate>
=== Backwards-compatible functionality === <!--T:19-->
</translate>
Functionality compatible with Wikimedia's DPL extension can be invoked with <syntaxhighlight lang=html inline><DynamicPageList> .... </DynamicPageList></syntaxhighlight>.
:''See: {{ll|Extension:DynamicPageList (Wikimedia)#Use|Extension:DynamicPageList (Wikimedia)#Use}}''

<translate>
==Overview== <!--T:20-->
</translate>
<translate><!--T:60--> Assume you have written some articles about ''countries''.</translate>
<translate><!--T:61--> Typically these articles will have three things in common:</translate>

* They will belong to a common category
* They will have a similar chapter structure, i.e. they will contain paragraphs named 'Religion' or 'History'
* They will use a template which is used to present highly structured short data items ('Capital', 'Inhabitants', ..) in a nice way (e.g. as a wikitable)

<translate>
===DPL generates reports on articles=== <!--T:21-->
</translate>
Let us assume that there is an article on Islam.
You want to give some information about the spreading of this religion over various countries.
But you do not want to create redundancy by repeating information that was already given in the articles on the countries.

In our scenario the natural approach with DPL would be to generate a list of 'countries' (=category) where Islam plays a role (i.e. restrict your selection to articles of category 'Country' which contain a link to 'Islam').
Typically you would want to include part of the text chapter on 'Religion' from each of the relevant countries.
You might also want to give the number of inhabitants for each country.
The output should be shown as an alphabetically ordered table.
It would be nice if the user could easily sort the table by inhabitants or some other criteria.

With DPL you can ..

* generate a list of all those articles (or a random sample)
* show metadata of the articles (popularity, date of last update, ..)
* show one or more chapters of the articles ('transclude' content)
* show parameter values which are passed to the common template
* order articles appropriately
* present the result in a sortable table (e.g.)
* use multi column output

<translate>
===Which steps are necessary?=== <!--T:22-->
</translate>
'''Find the articles you want to list:'''

* select by a logical combination (AND,OR,NOT) of categories
* specify a range for the number of categories the article must be assigned to
* select by a logical combination (AND,OR,NOT) of namespaces
* define a pattern which must match the article's name
* name a page to which the article must or must not link
* name a template which the article must or must not use
* name a text pattern which must occur within external links from a page
* exclude or include redirections
* restrict your search to stable pages or quality pages ("flagged revisions")
* use other criteria for selection like author, date of last change etc.
* define regular expressions to match the contents of pages you want to include

'''Order the result list of articles according to'''

* name
* date of last change
* popularity
* user who changed them last
* size
* restrict the output to the first n articles or to a random sample
* use descending or ascending sequence

'''Define attributes you want to see'''

* article name
* article namespace
* article size
* date of last change
* date of last access
* user who changed them last

'''Define contents you want to show'''

* whole article
* contents of certain chapters (identified by headings)
* text portions (defined by special marker tags in the article)
* values of template calls
* substitute the original template by a different one and show the output of that template

'''Define the output format'''

* specify headline and footer for your report
* use ordered list, unordered list
* use tables, sorted tables (using javascript)
* format table fields individually by applying templates to their content
* use category style listing
* create "tag clouds" by varying output text size depending on popularity of pages
* multi column output
* truncate title or contents to a certain maximum length
* add a link to the article or to one or more of its chapters

<translate>
===DPL generates reports on categories=== <!--T:23-->
</translate>
Apart from producing a list of pages which match certain criteria, DPL can also create a list of categories a selected set of pages belongs to.
This can be useful to get an idea of the semantic scope of a group of pages (which can be defined by some arbitrary criteria).
One of the more useful applications would be question like: "To which categories do the pages belong which contain a reference to the current page?"

<translate>
===DPL can be used for bulk editing=== <!--T:24-->
</translate>
Sometimes you want to perform a similar editing task on many articles (like adding a template at the beginning of the text).
DPL has a feature which allows you to update other articles based on regular expressions.
This feature is experimental and can be disabled in the DPL config file.

<translate>
===DPL interacts with other extensions=== <!--T:25-->
</translate>
There is a special mechanism which allows you to call your own extension inside the result loop of a DPL query.
This opens doors for assembling new 'applications' without having to program on php level.
For example you can create menu trees for [[Extension:Treeview]], you can generate nice bar graphs or pie charts using DPL together with ''Ploticus'', you can call 'gallery' or whatever you want...

<translate>

===DPL is a platform for building other applications=== <!--T:26-->
</translate>
The power of DPL makes it possible to create applications on wiki template level which would normally require PHP programming.
One example of this is a light-weight "semantic wiki" approach.
See the [https://followthescore.org/dpldemo DPL demo page] for details.

<translate>
===DPL and performance=== <!--T:27-->
</translate>
With a few lines of DPL code it is possible to create huge output and CPU load (think of a DPL query which tries to include the contents of all articles in your mediawiki ;-)).
Normally this is not a problem because users who write DPL queries have some level of expertise.
If you are afraid, however, you can restrict the execution of DPL queries to ''protected articles''.

Apart from that the general performance of DPL on medium-size wikis is quite acceptable (see the performance tests on the dpldemo website).
Use of [https://followthescore.org/dpldemo/index.php?title=DPL:Manual_-_DPL_parameters:_Other_parameters#allowcachedresults allowcachedresults] and/or [https://followthescore.org/dpldemo/index.php?title=DPL:Manual_-_DPL_parameters:_Other_parameters#dplcache dplcache] where possible can improve performance.

<translate>
==See also== <!--T:28-->

===Further reading=== <!--T:29-->
</translate>
DPL can do much more than we can explain here.
The complete [https://followthescore.org/dpldemo/index.php?title=Extension_DPL full original manual] or [https://web.archive.org/web/20161105221036/http://semeb.com/dpldemo/DPL:Manual manual] (German Manual [http://www.wiki-aventurica.de/wiki/Hilfe:Dynamic_Page_List Hilfe:DynamicPageList]) describes more.

<translate>
===Related extensions=== <!--T:30-->
</translate>
* {{ll|Manual:Managing data in MediaWiki}} – An overview and comparison.
* {{ll|Extension:Semantic MediaWiki}} turns links and data in wiki pages into queryable information
* {{ll|Extension:NukeDPL}} deletes pages based on DynamicPageList; also useful for testing different DPL settings without actually deleting the pages

[[Category:Category extensions{{#translation:}}]]
[[Category:List extensions{{#translation:}}]]
[[Category:Namespace extensions{{#translation:}}]]
[[Category:Special page extensions{{#translation:}}]]
[[Category:Table extensions{{#translation:}}]]
[[Category:Page content extensions{{#translation:}}]]
[[Category:Tag cloud extensions{{#translation:}}]] <!-- has tag cloud display option -->
[[Category:Category intersection extensions{{#translation:}}]]

Latest revision as of 12:23, 3 June 2024