Community Central
Community Central
mNo edit summary
m (Replacing old tags, i.e. tt --> code)
Tag: Help
(25 intermediate revisions by 14 users not shown)
Line 1: Line 1:
  +
{{Extension infobox
{{Available on request}}
 
 
| name = DynamicPageList
  +
| version = 3.3.3
  +
| author =
  +
* Gero Scholz
  +
* Alexia E. Smith
  +
| link =
  +
* [[w:c:help:Extension:DPL3|Gamepedia Help Wiki]]
  +
* [[mw:Extension:DynamicPageList3|MediaWiki.org]]
  +
* [https://gitlab.com/hydrawiki/extensions/DynamicPageList GitLab]
  +
| desc = {{int:dpl-desc}}
  +
| default = request
  +
}}
 
{{Tocright}}
 
{{Tocright}}
 
'''DPL''', also known as the '''Dynamic Page List''' extension, is a powerful [[Help:MediaWiki|MediaWiki]] extension that allows for the creation of lists of pages using various criteria, such as membership in a [[Help:Category|category]] or inclusion of a specific [[Help:Templates|template]]. These lists are considered ''dynamic'' because they automatically update as users add categories to pages.
 
'''DPL''', also known as the '''Dynamic Page List''' extension, is a powerful [[Help:MediaWiki|MediaWiki]] extension that allows for the creation of lists of pages using various criteria, such as membership in a [[Help:Category|category]] or inclusion of a specific [[Help:Templates|template]]. These lists are considered ''dynamic'' because they automatically update as users add categories to pages.
   
For instance, if you wanted to find out all the episodes of ''The West Wing'' that were written by Aaron Sorkin and that guest-starred Hal Holbrook, DPL could tell you in a flash. Or if you needed to answer the question, "Are there any civilian half-human Vulcans in ''Star Trek''?" DPL could help find those people who were in '''Category:Vulcans''' and '''Category:Half-humans''' but not '''Category:Starfleet officers'''.
+
For instance, if you wanted to find out all the episodes of ''The West Wing'' that were written by Aaron Sorkin and that guest-starred Hal Holbrook, DPL could tell you in a flash. Or if you needed to answer the question, "Are there any civilian half-human Vulcans in ''Star Trek''?" DPL could help find those people who were in '''Category:Vulcans''' and '''Category:Half-humans''' but not '''Category:Starfleet officers'''.
   
 
Because of its great power, DPL increases server load and can result in significantly slower page loads for wikis that use it. And because DPL has numerous parameters and applications, we can't reasonably hope to explain it on a single help page. Therefore, Fandom strongly encourages you to pay special attention to a couple of sections of this article: "'''[[#Using DPL effectively|Using DPL effectively]]'''" and "'''[[#More about DPL|More about DPL]]'''".
 
Because of its great power, DPL increases server load and can result in significantly slower page loads for wikis that use it. And because DPL has numerous parameters and applications, we can't reasonably hope to explain it on a single help page. Therefore, Fandom strongly encourages you to pay special attention to a couple of sections of this article: "'''[[#Using DPL effectively|Using DPL effectively]]'''" and "'''[[#More about DPL|More about DPL]]'''".
  +
  +
Fandom is using [[mw:Extension:DynamicPageList3|DynamicPageList3]]. You can find the [[w:c:Help:Extension:DPL3/Manual|full manual here]].
   
 
== Benefits of DPL ==
 
== Benefits of DPL ==
Line 11: Line 25:
 
* Creates dynamic listings of pages based on various parameters, such as page titles, namespaces, membership in a category, template inclusion, and more. For example, you can create a page that lists all pages in two categories but not in a third.
 
* Creates dynamic listings of pages based on various parameters, such as page titles, namespaces, membership in a category, template inclusion, and more. For example, you can create a page that lists all pages in two categories but not in a third.
 
* Can include page information such as date of the last edit, the username of last editor, and more.
 
* Can include page information such as date of the last edit, the username of last editor, and more.
* Can display lists in tables, bulleted or numbered lists, in category page style, or inline.
+
* Can display data in tables, bulleted or numbered lists, in category page style, or inline.
 
* Allows creation of lists with custom styles and formatting inserted in-between items.
 
* Allows creation of lists with custom styles and formatting inserted in-between items.
   
 
== How to include DPL on a page ==
 
== How to include DPL on a page ==
DPL queries start with the <code><nowiki><dpl></nowiki></code> tag and close with the <code><nowiki></dpl></nowiki></code> tag. Within these tags, users may put a wide variety of parameters to customize and tailor the query to their needs. You can also use <code><nowiki>{{#dpl: .... }}</nowiki></code> instead. You need to use "source" mode to create DPL queries, see [[Help:Source edit mode]] for information on how to access "source" mode in your preferred editor.
+
DPL queries start with the <code><nowiki><dpl></nowiki></code> tag and close with the <code><nowiki></dpl></nowiki></code> tag. Within these tags, users may put a wide variety of parameters to customize and tailor the query to their needs. You can also use parser function version <code><nowiki>{{#dpl: .... }}</nowiki></code> if you need to have parser functions in the DPL parameters expanded before the query is made. You need to use the "source" editor mode to create DPL queries, see [[Help:Source edit mode]] for information on how to access "source" mode in your preferred editor.
   
 
Here is a very basic DPL query example:
 
Here is a very basic DPL query example:
  +
<pre><DPL>
 
  +
<pre>
  +
<dpl>
 
category = Characters
 
category = Characters
</DPL></pre>
+
</dpl>
  +
</pre>
   
This query above would output a list of all the pages that are in the category Characters.
+
This query above will output a list of all the pages that are in the category Characters.
   
 
This can be further customized:
 
This can be further customized:
  +
<pre><DPL>
 
  +
<pre>
  +
<dpl>
 
category = Characters
 
category = Characters
 
notcategory = Season 1 Characters
 
notcategory = Season 1 Characters
 
namespace = Character
 
namespace = Character
 
mode = ordered
 
mode = ordered
</DPL></pre>
+
</dpl>
  +
</pre>
   
This query would display all pages that are in the Character namespace and have the category Characters if the page also did not have the category Season 1 Characters. This list would also be printed as a <nowiki><ol></nowiki> as opposed to the default <nowiki><ul></nowiki>.
+
This query will display all pages that are in the Character namespace and have the category Characters if the page also did not have the category Season 1 Characters. This list will also be printed as an ordered list (<nowiki><ol></nowiki>) as opposed to the default unordered list (<nowiki><ul></nowiki>).
   
 
== Using DPL effectively ==
 
== Using DPL effectively ==
 
DPL can cause heavy server loads, slowing the entire site down. The following are tips on how to get around the problem.
 
DPL can cause heavy server loads, slowing the entire site down. The following are tips on how to get around the problem.
   
First, consider whether your DPL usage is necessary. If it's only used because it's "cool", you might be able to provide something equally cool to your users in the same space, such as a [[Help:Polls|poll]], [[Help:Calendar|calendar]], [[Help:RSS|embedded RSS feed]], [[Help:Videos|embedded video]], and more.
+
First, consider whether your DPL usage is necessary. If you just want a list of the members of a category, then a link to the category page will do. If it's only used because it's "cool", you might be able to provide something equally cool to your users in the same space, such as a [[Help:Calendar|calendar]], [[Help:Videos|embedded video]], and more.
   
Secondly, if you decide DPL is the best tool for the job, <u>let DPL cache results!</u> Simply add this line to your DPL query: <pre>allowcachedresults = true</pre>
+
Secondly, if you decide DPL is the best tool for the job, <u>let DPL cache results!</u> Simply add this line to your DPL query:
  +
  +
<pre>allowcachedresults = true</pre>
  +
  +
(Note: due to excessive server load, this option is always set to true, regardless of user input. In order to update the cache to see fresh results, you will need to [[Help:Purge|purge]] the page cache.)
   
 
=== Use other tools for common DPL uses ===
 
=== Use other tools for common DPL uses ===
 
;Creating simple category lists
 
;Creating simple category lists
:For creating simple category lists you might use the <nowiki><categorytree></nowiki> tag ([[mw:Extension:CategoryTree#The &lt;categorytree&gt; tag|documentation]]). For instance, to get a list of pages in the category 'Community' consider the following: <pre><nowiki><categorytree mode="pages" hideroot=on>Community</categorytree></nowiki></pre>
+
:For creating simple category lists you might use the [[Help:CategoryTree|<nowiki><categorytree></nowiki> tag]] ([[mw:Extension:CategoryTree#The &lt;categorytree&gt; tag|documentation]]). For instance, to get a list of pages in the category 'Community' consider the following:<pre><nowiki><categorytree mode="pages" hideroot="on">Community</categorytree></nowiki></pre>
   
 
;Random content
 
;Random content
Line 52: Line 76:
   
 
;Wiki-style forums
 
;Wiki-style forums
:See [[Help:Wiki-style forums]] for the <code><nowiki><forum>&hellip;</forum></nowiki></code> syntax.
+
:See [[Help:Wiki-style forums]] for the <code><nowiki><forum>&hellip;</forum></nowiki></code> syntax. This uses DPL behind the scenes but with functionality customized to making a wiki-page based Forum system.
   
 
;Advanced uses
 
;Advanced uses
Line 58: Line 82:
   
 
=== Things to avoid ===
 
=== Things to avoid ===
  +
Please avoid overusing:
Do not use DPL for:
 
 
* Functions using "randomcount"; they can't be cached
 
* Functions using "randomcount"; they can't be cached
 
* Templates that are used site-wide; it creates hidden DPL calls all over the wiki
 
* Templates that are used site-wide; it creates hidden DPL calls all over the wiki
Line 65: Line 89:
   
 
== Sometimes you need to purge ==
 
== Sometimes you need to purge ==
If you see strange output from DPL, try putting <tt>?action=purge</tt> (or <tt>&action=purge</tt>, if <tt>?</tt> is already used) at the end of your URL and reload the URL. This can fix problems where DPL backend code was updated, but the server cache was not refreshed.
+
If you see strange or outdated output from DPL, try putting <code>?action=purge</code> (or <code>&action=purge</code>, if <code>?</code> is already used) at the end of your URL and reload the URL. This will force a server cache flush for the page
   
 
== Common uses for DPL ==
 
== Common uses for DPL ==
 
=== Galleries ===
 
=== Galleries ===
 
DPL can be used to make self maintaining galleries:
 
DPL can be used to make self maintaining galleries:
  +
<pre><DPL>
 
 
<pre><dpl>
 
namespace = File
 
namespace = File
 
category = CategoryNameHere
 
category = CategoryNameHere
 
format = <gallery widths="150" spacing="small">,%PAGE%\n,,</gallery>
 
format = <gallery widths="150" spacing="small">,%PAGE%\n,,</gallery>
 
allowcachedresults = true
 
allowcachedresults = true
</DPL></pre>
+
</dpl></pre>
  +
  +
If you are using the parser function version of DPL, you must use [[mw:Extension talk:DynamicPageList3#Gallery_tag_stops_the_processing_of_Format_special_symbols|this fix]] to output into galleries.
   
 
=== Pending work ===
 
=== Pending work ===
 
DPL can be used to make lists of things that need to be edited:
 
DPL can be used to make lists of things that need to be edited:
  +
<pre><DPL>
 
 
<pre><dpl>
 
category = Stubs
 
category = Stubs
 
format = ,#%PAGE%\n,,
 
format = ,#%PAGE%\n,,
 
allowcachedresults = true
 
allowcachedresults = true
</DPL></pre>
+
</dpl></pre>
   
 
DPL can be used to make a list of images that need to be categorized:
 
DPL can be used to make a list of images that need to be categorized:
  +
<pre><DPL>
 
 
<pre><dpl>
 
namespace = File
 
namespace = File
 
notcategory = Season 1
 
notcategory = Season 1
Line 94: Line 123:
 
format = <gallery widths="150" spacing="small">,%PAGE%\n,,</gallery>
 
format = <gallery widths="150" spacing="small">,%PAGE%\n,,</gallery>
 
allowcachedresults = true
 
allowcachedresults = true
</DPL></pre>
+
</dpl></pre>
   
 
== Notes ==
 
== Notes ==
Line 101: Line 130:
   
 
== More about DPL ==
 
== More about DPL ==
  +
* [[w:c:Help:Extension:DPL3/Manual|The DPL 3 Manual on Gamepedia]]
* [http://followthescore.org/dpldemo/DPL:Manual The DPL Manual], which includes a comprehensive list of all DPL parameters
 
  +
* [[/Conversion cheat sheet|FAQ on converting legacy DPL functions to UCP]]
 
* [https://followthescore.org/dpldemo/index.php?title=DPL:Manual The Manual for the version used by Fandom before UCP]
 
* [https://web.archive.org/web/20161105221036/http://semeb.com/dpldemo/DPL:Manual The archived DPL Manual]
 
* [https://web.archive.org/web/20161105221036/http://semeb.com/dpldemo/DPL:Manual The archived DPL Manual]
 
* [[w:c:memory-alpha:MA Help:Dynamic page list|Memory Alpha's entirely original help page]], which includes a number of Fandom-relevant examples of DPL usage.
* [[mw:Extension:DynamicPageList (third-party)|MediaWiki.org's page about the extension itself]]
 
* [[w:c:memory-alpha:Help:Dynamic page list|Memory Alpha's entirely original help page]], which includes a number of Fandom-relevant examples of DPL usage.
 
   
 
== Further help and feedback ==
 
== Further help and feedback ==
 
{{Help and feedback section}}
 
{{Help and feedback section}}
  +
[[be:Help:DynamicPageList]]
 
 
[[de:Hilfe:DynamicPageList]]
 
[[de:Hilfe:DynamicPageList]]
 
[[es:Ayuda:Lista de páginas dinámica]]
 
[[es:Ayuda:Lista de páginas dinámica]]
Line 114: Line 144:
 
[[ja:ヘルプ:ダイナミック・ページ・リスト]]
 
[[ja:ヘルプ:ダイナミック・ページ・リスト]]
 
[[ko:도움말:고급 문서 목록]]
 
[[ko:도움말:고급 문서 목록]]
  +
[[pl:Pomoc:DynamicPageList]]
 
[[pt:Ajuda:DynamicPageList]]
 
[[pt:Ajuda:DynamicPageList]]
 
[[ru:Справка:DynamicPageList]]
 
[[ru:Справка:DynamicPageList]]
  +
[[tr:Yardım:DynamicPageList]]
 
[[uk:Довідка:DynamicPageList]]
 
[[uk:Довідка:DynamicPageList]]
 
[[zh:Help:動態頁面列表]]
 
[[zh:Help:動態頁面列表]]
[[pl:Pomoc:DynamicPageList]]
 
 
[[Category:Help]]
 
[[Category:Help]]
 
[[Category:Common extensions]]
 
[[Category:Common extensions]]

Revision as of 14:26, 17 June 2021

DPL, also known as the Dynamic Page List extension, is a powerful MediaWiki extension that allows for the creation of lists of pages using various criteria, such as membership in a category or inclusion of a specific template. These lists are considered dynamic because they automatically update as users add categories to pages.

For instance, if you wanted to find out all the episodes of The West Wing that were written by Aaron Sorkin and that guest-starred Hal Holbrook, DPL could tell you in a flash. Or if you needed to answer the question, "Are there any civilian half-human Vulcans in Star Trek?" DPL could help find those people who were in Category:Vulcans and Category:Half-humans but not Category:Starfleet officers.

Because of its great power, DPL increases server load and can result in significantly slower page loads for wikis that use it. And because DPL has numerous parameters and applications, we can't reasonably hope to explain it on a single help page. Therefore, Fandom strongly encourages you to pay special attention to a couple of sections of this article: "Using DPL effectively" and "More about DPL".

Fandom is using DynamicPageList3. You can find the full manual here.

Benefits of DPL

DPL

DPL is very effective because a little bit of code can produce a long and detailed list of information that would take a long time to construct manually.

  • Creates dynamic listings of pages based on various parameters, such as page titles, namespaces, membership in a category, template inclusion, and more. For example, you can create a page that lists all pages in two categories but not in a third.
  • Can include page information such as date of the last edit, the username of last editor, and more.
  • Can display data in tables, bulleted or numbered lists, in category page style, or inline.
  • Allows creation of lists with custom styles and formatting inserted in-between items.

How to include DPL on a page

DPL queries start with the <dpl> tag and close with the </dpl> tag. Within these tags, users may put a wide variety of parameters to customize and tailor the query to their needs. You can also use parser function version {{#dpl: .... }} if you need to have parser functions in the DPL parameters expanded before the query is made. You need to use the "source" editor mode to create DPL queries, see Help:Source edit mode for information on how to access "source" mode in your preferred editor.

Here is a very basic DPL query example:

<dpl>
    category = Characters
</dpl>

This query above will output a list of all the pages that are in the category Characters.

This can be further customized:

<dpl>
    category    = Characters
    notcategory = Season 1 Characters
    namespace   = Character
    mode        = ordered
</dpl>

This query will display all pages that are in the Character namespace and have the category Characters if the page also did not have the category Season 1 Characters. This list will also be printed as an ordered list (<ol>) as opposed to the default unordered list (<ul>).

Using DPL effectively

DPL can cause heavy server loads, slowing the entire site down. The following are tips on how to get around the problem.

First, consider whether your DPL usage is necessary. If you just want a list of the members of a category, then a link to the category page will do. If it's only used because it's "cool", you might be able to provide something equally cool to your users in the same space, such as a calendar, embedded video, and more.

Secondly, if you decide DPL is the best tool for the job, let DPL cache results! Simply add this line to your DPL query:

allowcachedresults = true

(Note: due to excessive server load, this option is always set to true, regardless of user input. In order to update the cache to see fresh results, you will need to purge the page cache.)

Use other tools for common DPL uses

Creating simple category lists
For creating simple category lists you might use the <categorytree> tag (documentation). For instance, to get a list of pages in the category 'Community' consider the following:
<categorytree mode="pages" hideroot="on">Community</categorytree>
Random content
Use RandomSelection.
Lists of users
Use Special:Listusers for this.
Wiki-style forums
See Help:Wiki-style forums for the <forum>…</forum> syntax. This uses DPL behind the scenes but with functionality customized to making a wiki-page based Forum system.
Advanced uses
For more advanced uses, please check that a more specialized extension is not available before using DPL. For example, instead of creating a calendar with DPL use one of the calendar extensions available. If you are unsure or don't see an extension you need, contact us and we'll be happy to help.

Things to avoid

Please avoid overusing:

  • Functions using "randomcount"; they can't be cached
  • Templates that are used site-wide; it creates hidden DPL calls all over the wiki
  • Large queries; don't display 500 results when 20 will do the job
  • More than one or two queries per page

Sometimes you need to purge

If you see strange or outdated output from DPL, try putting ?action=purge (or &action=purge, if ? is already used) at the end of your URL and reload the URL. This will force a server cache flush for the page

Common uses for DPL

Galleries

DPL can be used to make self maintaining galleries:

<dpl>
    namespace          = File
    category           = CategoryNameHere
    format             = <gallery widths="150" spacing="small">,%PAGE%\n,,</gallery>
    allowcachedresults = true
</dpl>

If you are using the parser function version of DPL, you must use this fix to output into galleries.

Pending work

DPL can be used to make lists of things that need to be edited:

<dpl>
    category           = Stubs
    format             = ,#%PAGE%\n,,
    allowcachedresults = true
</dpl>

DPL can be used to make a list of images that need to be categorized:

<dpl>
    namespace = File
    notcategory = Season 1
    notcategory = Season 2
    notcategory = Season 3
    notcategory = Season 4
    format = <gallery widths="150" spacing="small">,%PAGE%\n,,</gallery>
    allowcachedresults = true
</dpl>

Notes

  • Fandom does not support the use of features based on a page's view count.
  • Both the DPL cache and the page's server cache must be updated in order for changes to be reflected.

More about DPL

Further help and feedback