- This extension is not enabled by default but may be available upon request.
DPL, also known as the DynamicPageList 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 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 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. Here's the list:
- 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.
An example page can be found in Help:Index.
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 load. 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 an embedded video, and more.
Though DPL3 automatically catches all outputs, limiting server load. If you need to update output on a page, simply purge the page.
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.
- List of subpages
- Use Special:PrefixIndex. For example, to generate a bulleted list of subpages of Help:Infoboxes, you can use
{{Special:PrefixIndex|prefix=Help:Infoboxes/|stripprefix=1}}
, which matches pages with the prefix "Help:Infoboxes/".
- List of pages in namespace
- Use Special:PrefixIndex. For example, to list all pages in the "Help" namespace, use
{{Special:PrefixIndex|prefix=Help:|stripprefix=1}}
or{{Special:PrefixIndex|stripprefix=1|namespace=12}}
. The parameterhideredirects=1
may be used to remove redirects from the output (which are otherwise italicised), whilestripprefix=1
removes the prefix or namespace name from the output, andnamespace
restricts the output to a specific namespace ID (namespace IDs).
- 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. 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.
- There is a limit of 500 items that can be outputted by DPL. Anymore will require setting the "offset" parameter.
Check if DPL is enabled[]
You can check if DPL is enabled on your wiki by going to Special:Version and look for "DynamicPageList3".
More about DPL[]
- The DPL 3 Manual on Fandom
- The new DPL3 manual on dpl3.your.wf
- FAQ on converting legacy DPL functions to UCP
- The manual for the version used by Fandom before UCP
- The archived DPL manual
- Memory Alpha's entirely original help page, which includes a number of Fandom-relevant examples of DPL usage.
Further help and feedback[]
- Browse and search other help pages at Help:Contents
- Check Fandom Community Central for sources of further help and support
- Check Contacting Fandom for how to report any errors or unclear steps in this article