DPL:Requests for new features Archive

From FollowTheScore
Jump to: navigation, search

The following requests were resolved some time ago.

    If you have a new request, add it to DPL:Requests for new features !


<noinclude> support

No idea if this is a bug or not so I'm putting this here.

We use DPL over at the Sawfish wiki to automatically generate a page 'News' containing all pages in our News category. This results in the News page becoming a member of the News category itself. It would be nice if we could prevent this from happening by writing something like this:


on the pages that get included. --Sven Schoenung 20:53, 31 July 2007 (CEST)

It´s not a feature, it´s a 'standard' consequence of the wiki parsing process - and it is most times quite unwanted...
The next release will contain a 'reset option' which prevents mediawiki from creating category links for transcluded text (the same happens with images and templates by the way). Sometimes you even don´t want the normal hyperlinks of a DPL query result to be recorded in the mediawiki database. There will be a switch for that as well.
Gero 23:47, 14 August 2007 (CEST)

Template call escaping in output


|listseparators=...,[{!-fullurl:%PAGE%¦diff=%REVISION%-!} diff],...

resulting in DPL output

[{{fullurl:SomeNamespace:Matching_Page¦diff=152}} diff]

and further transformed into a link. The regular form won't work because fullurl would be called before %PAGE% et al. are substituted.

I implemented this way:

$dpl2result = str_replace( '-!}', '}}', str_replace( '{!-', '{{', $dpl2result ));

in the // ###### SHOW OUTPUT ###### block. Please tell me if it sounds wrong, dangerous or anything. - 16:49, 10 August 2007 (CEST)

The next DPL release (1.3.2) will have a mechanism which optionally postpones template expansion to the moment after the execution of the query. It will be similar to the twin angle brackets now used for delayed tag expansion. This will make nested DPL calls possible plus applications like the one above. In fact it really opens a door to more creative applications of DPL. Somewhen next week ... Gero 00:00, 11 August 2007 (CEST)


"%DPL-1.2.5-WARNING: No results!" is a tad bit vague (note the sarcasm). -Eep² 12:40, 24 July 2007 (CEST)

What do you expect instead? Did you notice the 'noresultsheader' option? Gero 20:30, 24 July 2007 (CEST)
Something like "no noresultsheader specified" or something. Even if you submit a default "report" (without changing anything), DPL just goes right back to the same screen without even saying anything is wrong. Basic javascript error-checking would be good without requiring a many server-hit response. Why does DPL cause so many server hits anyway? Seems like every page takes at least 10 hits before it finally shows up anyway (status bar flashes like mad)... -Eep² 21:44, 24 July 2007 (CEST)

The 'noresultsheader' option works nicely for me. However, what about the There are 0 results, There is 1 result and There are 2 results... problem? How about 'oneresultheader'? This is actually a real and somewhat pressing issue.  — Frank 10:15, 09 August 2007 (EDT)

The next release will have a 'oneresultheader' option. Gero 23:13, 14 August 2007 (CEST)

Oneresultfooter, similar to the oneresultheader, but for the footer. Perhaps a noresultfooter is useful too if there could be an appearance difference between noresultheader and noresultfooter.

--Sandman 22:23, 2 September 2007 (CEST)

Exclude Subpages

Our wiki uses the DPL in quite a few places (It is the wiki the DPL2 was originally written for). Recently we have startet to use subpages as additional source of information, but don't want to include these in our DPL-queries. So we need a switch that excludes subpages.

Syntax Suggestion

includesubpages set to false to exclude Subpages. Default is true.

Implementation details

Title.php (so any Title-Object you create) has a function isSubpage() that returns true if the page is a subpage. I guess this feature should be easy to implement?


This feature became part of release 1.3.6 exactly as specified. I could not find the isSubpage() function, so DPL tests against a '/' in the title name. There should be some testing on %PAGES%, count, offset etc. before this feature can be considered stable.

ISO 8601 - DynamicPageListSP_body.php

			    $wikitext2=	   "createdby          =? username"
			               	."\nmodifiedby         =? username"
			               	."\nlastmodifiedby     =? username"
			    			."\nfirstrevisionsince =? yyyy/mm/dd"
			               	."\nallrevisionssince  =? yyyy/mm/dd"
			               	."\nlastrevisionbefore =? yyyy/mm/dd"
			               	."\nallrevisionsbefore =? yyyy/mm/dd"
			               	."\nnotcreatedby       =? user"
			               	."\nnotmodifiedby      =? username"
			               	."\nnotlastmodifiedby  =? username"

replace yyyy/mm/dd with YYYY-MM-DD (For what I tested parsing already works, i.e. no dependencies for that change.)

YYYY-MM-DD - this is the way ISO 8601 refers to it. (no lowercase yyyy, mm or dd).

Tobias Conradi 17:19, 16 August 2007 (CEST)

Limit number of results

Would be nice if one could limit the number of results. For example: show first ten pages with category=country. Would also be very useful for upcoming events list :-) —The preceding unsigned comment was added by (talkcontribs) 14:41, August 13, 2007. Please sign your posts!

You can do that. Use the count option. --Sven Schoenung 23:44, 13 August 2007 (CEST)

redirects include pages that link to redirects

See DPL:Discussion#Redirects to include pages that link to them? -Eep² 05:07, 13 August 2007 (CEST)

How about "mode = tagcloud"

For those funky (boring) tag cloud listings of pages? Here the real order would be random, but the size of the tag would be set by ordermethod.

I am going to have to look at the code sooner or later !

--Dmb 18:19, 10 August 2007 (CEST)

Tagcloud ordering isn't random, but alphabetical (usually) or based on relevance. Various sorting methods would be nice though, but I'd rather be able to create tables with headers on columns instead of only rows, support for links to redirected articles (as Special:Whatlinkshere shows), and other improvements I've asked about recently. Gero seems to be on vacation/holiday though... -Eep² 18:28, 10 August 2007 (CEST)
We should get hacking! where is the code ? \me hunts around (for some spare time at least). --Dmb 08:23, 14 August 2007 (CEST)
The source code has always been available as a ZIP file. But be warned: It is much more complex than you might expect. If you want to improve a single feature like tag clouds I would recommend that you download the latest version and change it according to your ideas. Then you should apply the diff tool and publish the increment here.
Gero 14:46, 15 August 2007 (CEST)

More boolean support

Instead of just "yes"/"no" and "true"/"false", how about allowing "on"/"off" (for HTML checkbox form support) and "1"/"0" for easier typing? -Eep² 09:40, 30 July 2007 (CEST)

Don't replace underscores by spaces


I'm running a programming language MediaWiki for which DPL is most suited. But listing functions with spaces instead of underscores looks a bit weird. Is it possible to tell DPL to not replace underscores in the links by spaces and to replace spaces in the links by underscores?

Something like:

category = functions
replacespaces = true

which would output:

* [[my_func]]
* [[my_other_func]]

instead of:

* [[my func]]
* [[my other func]]

It would mean a great deal to me and the community. Thanks in advance.

--Sandman 02:39, 25 July 2007 (CEST)

PS: If this can be setup somewhere in regular MediaWiki, please inform me of it.


Have you seen the 'replaceintitle' option? Maybe you could use 'mode=userformat' and [[%TITLE%]]. Although this will probably not work with namespaces. If you can´t get along with this approach, let me know.

Regarding DPL on Wikipedia etc.: I am not familiar with the kind of lobbying that would be required for this. But I think it could be quite helpful in almost every wiki. See my note on bugzilla. Maybe you want to add a statement there?

Gero 05:33, 25 July 2007 (CEST)

Reply #2

I created an article with underscores in its name. Normally this would give a result like

Please note that the link itself still contains the underscore. DPL converts underscores to spaces as this is common expectation in wikis. You can revert this behaviour using 'replaceintitle'. Note that you have to use the html special name for the underscore (otherwise your substitution will be overwritten by DPL). So your code should look like this:

<pre> <dpl> titlematch=%underscore replaceintitle=/ /,_ </dpl> </pre> It will produce the result

And I guess, that´s what you wanted. This solution will also work with articles in all namespaces.

Gero 05:55, 25 July 2007 (CEST)


Yes, this is what I needed, thanks! Sorry it was already featured; too bad MediaWiki itself doesn't seem to have this feature. I've left a statement at the location you requested with nothing but praises. ;-)

--Sandman 17:54, 25 July 2007 (CEST)

Multiple columns with headingmode


Maybe this is doable already but I couldn't figure it out: I want to use ordermethod=category,sortkey and headingmode but I want it in multi-column form (or have more user control regarding the output format). There's a column parameter but it doesn't seem to work with headingmode. Another possibility is if I could use mode=userformat and somehow simulate the behavior of multi-column headingmode. I realize that the columns might not be all the same length as there could be different number of pages in each category. I think the simplest implementation would be to put one category heading in each column and ignore the list under each category.


In fact 'headingmode' did not work with multi-column output. The next release will have that feature. Indeed it is not easy to get the column lengths balanced; DPL will use a rough heuristic which states that a heading consumes the space of 2 normal entries. Gero 23:53, 14 August 2007 (CEST)

Create a special page for searching pages with DPL


  • It could be interesting to have a special page that does a search based on a DPL. The DPL parameters would be set in a form (that could be enhanced in time with some common values).
  • The current search functionality in Mediawiki is quite limited, and DPL adds much power here.
  • Example: I want all the pages edited by user X in category Y and category Z, etc...
  • This is just a random idea, as I sometime had to query by editing a page and doing a preview without saving. Being able to do a DPL search and get a result set on a page without having to edit a page would be nice.

--Ycombarnous 14:55, 10 April 2007 (CEST)


  • I created the base frame for such a "specials" page. But I will not have time to work on it. See the source archive, and feel free to start coding. -- Gero 19:44, 21 April 2007 (CEST)
  • I know it's quite a lot of work. I will try and make a static proposal for the page, and work on it as time allows. thanks. --Ycombarnous 10:32, 23 April 2007 (CEST)
  • I also thought this would be useful so I implemented something very simple and more general. It's a special page that is a generic wikitext parser (and so works with DPL and any other parser extension). It lets you bookmark a link to a search query via DPL for example. See here for an example. The source code is here. --Austin

  • This looks interesting, Austin! Maybe we can build a simple solution based on your extension --Gero 20:17, 26 April 2007 (CEST)
  • Well, there is a first trial version of DPL-special-page available with version 1.1.4. I started with the code from Austin and added my ideas. Have a look! --Gero 14:48, 30 April 2007 (CEST)

  • It's a good start, but I was actually thinking more to someting like Bugzilla boolean charts (go to a bugzilla install, in "advanced search", and see the section at bottom (called Advanced Searching Using Boolean Charts). Basically, you have per line:
    • the field you want to set a value on
    • the type of matching you look for (would correspond to match / in / not in for DPL)
    • and finally your value
    • in addition, you can add as many lines as you want
  • It would require some javascripting telling for each field the corresponding matching available, plus if several lines use the same field with different criteria, a concatention would be needed. What do you think? --Ycombarnous 17:07, 30 April 2007 (CEST)
What you described would certainly be a much better way to implement it. I was only looking for a "developer´s help tool" which offers the big variety of available parameters and allows a quick trial&error-cycle. I will not find time to do anything beyond that, I´m afraid.
Gero 20:10, 2 May 2007 (CEST)

Simple Forms extension

Extension:SimpleForms can work very well with DPL, it's still under development, but the DPL example on the page works and is a basis for making more complex query forms/reports. OrganicDesign main page shows the example working. --Nad 03:31, 29 April 2007 (CEST)

Output Format suited for SpecialExport

Would it be possible to have an 'output format' that would be more suited for 'cut and pasting' to Special:Export ?

The use-case is the following:

  • User creates a DPL query on 'My Pages To Export'
  • User saves the page 'My Pages To Export'
  • User views the said page & 'cut and paste' the result from the view into 'Special:Export'
  • User exports pages


Reply (with example)

This should be fairly easy to do. Try something like
   {{#dpl:mode=userformat|titlematch=Ca%|listseparators=,\n %PAGE%,}}

Note the leading colons and the slashes for subpages. I think you could paste this result directly into the export textarea.

Cache Demo 2
Cannot perform logical operations
Calendar zh-tw/Demo
Call extension
Cache API
Cache Demo 1
Calendar zh-tw
Talk:Calendar zh-tw
Talk:Call extension
Talk:Cache API
User talk:Capmo
:File:Catlist error msg 001.png
:File:Calendar templates-20071124.xml
Template:Calendar link zh-tw
Template:Calendar navigation
Template:Category with count
Template:Calendar anchor
Template:Category handler/numbered
Template:Category handler/blacklist
Template:Calendar link
Template:Calendar month
Template:Calendar month zh-tw
Template:Category handler
Template:CalendarSingle zh-tw
Template:Catlist zh
Template:Catlist/zh 2
Template talk:Calendar link
Template talk:CatTree
Template talk:Calendar month
Template talk:CalendarSingle
Template talk:Catlist
:Category:Cat d'Test
:Category:Cat 2
:Category:Cat 1
:Category:Cat 11
:Category:Cat 12
:Category:Café d'Anvers
:Category:Calendar Templates
DPL talk:Catlist
Issue:Calendar - combine create event and dayview
Issue:Cannot include a template call that uses a 2nd template variable
Issue:Calendar : Current event + create event
Issue:Caching on Mediawiki 1.13
Issue:Calendar create event bug
Issue:Call - passing a variable twice
Issue:Category names with ampersand not found?
Issue:Category browsing with title from / until
Issue:Calendar - without event template
Issue:Call-time pass-by-reference
Issue:Calendar - ical / template
Issue:Call-time pass-by-reference dpl 1.7.9 mw 1.13
Issue:Call-time pass-by-reference deprecated
Issue:Category=*somecategory combined with ordermethod=category,sortkey does not list subpages
Issue:Calendar - range
Issue:Category:New format symbols: %PREV% and %NEXT%
Issue:Categorymatch=with apostrophe
Issue:Can't call a EmbedVideo extension with the Parser function method
Issue:Category option that does AND operation to multiple parameters
Issue:Call to a member function getPrefixedDBkey() on a non-object

Furthermore, it should not be too complicated to set up a nice little collection of GUI widgets which offer drop down boxes for categories to the user, etc..
See the comments above regarding the DPL special page. I would be glad if somebody came up with a nice "My Pages To Export" page based on DPL. I am not sure whether you would really need a hook or php call level communication for that purpose... It could be a variant of Template:Catlist.

Gero 20:51, 24 July 2007 (CEST)
The next release of DPL contains an optiopn within the DPL GUI which allows to export all pages of a DPL result set. Gero 23:14, 14 August 2007 (CEST)

Could it be possible Template:Catlist produce the query-argument

Hi Gero. The Template:Catlist page can produce the result of query now. But could it be possible that the Template:Catlist page produce the query-argument that we can copy and reuse it? Thank you!--Roc michael 16:11, 22 August 2007 (CEST)

A nice suggestion. I changed the code. Gero 19:56, 22 August 2007 (CEST)

Template:Catlist Chinese version

Hi Gero. I tried to translate the Template:Catlist to Chinese version. Could you put the link to somewhere that more people could see and improve it? Thank you!--Roc michael 15:43, 24 August 2007 (CEST)

Hi michael, I appreciate your effort and I put an entry into the NavBar. Gero 17:12, 24 August 2007 (CEST)

linksto and other parameter case-insensitivity option

I need this without having to manually specify lower-/upper-case versions of every page... -Eep² 13:29, 2 September 2007 (CEST)

Mediawiki is case-sensitive by nature. So I can´t see what this should be good for ... Abc is the same as abc but is different from aBc and abC. DPL works on internal page_id numbers and these only exist for existing articles. Gero 14:31, 2 September 2007 (CEST)
Why must you fight me at every point in getting new features in DPL to make it easier to use, Gero? Geez. "Abc" is not the same as "abc" if $wgCapitalLinks = false; is set in localsettings.php, as I have it set in my wiki. I use DPL to list redirects but it requires a lot of variations on the page and support for multiple manually-entered parameters:
This query doesn't have any problem if any of these pagename variations don't exist so why would linksto have a problem with pagename case variations either??
Is this like how you couldn't see what "on"/"off" and "1"/"0" for boolean operators is good for? Or why someone would want to create table columns vs. rows (as I want for each game in my comparison table)? It's like the redirect issue you have been resisting and how MediaWiki devs resist adding suffix index (Special:Prefixindex in reverse) despite DPL being able to do it easily enough using a simple wildcard titlematch query (see http://www.tnlc.com/wiki/index.php?title=fire for an example). Enhancements like these make MediaWiki (and DPL) easier (and less frustrating) to use... -Eep² 15:38, 2 September 2007 (CEST)

Returning categories only


Somewhat related to the "Multiple columns with headingmode" question: I would like to be able to return only the categories that a set of pages belong to and not the pages themselves. That is, I would like to get behavior similar to ordermethod=category,sortkey and headingmode where all the categories that a set of pages is returned as the list itself (and the pages thrown away). Ideally, it would be possible to format the list of categories returned. Perhaps if a headingmode=userformat was created, that would be sufficient as you could throw away the rest of the data with mode=userformat without a defined listseparators. (Example application: Of all pages in a certain given category, what are all the other categories those pages are in?)


This is really a very interesting idea! Although it adds another portion of complexity to the code of DPL I tried to implement this feature. By setting "goal=categories" you state that you are going for a result which consists of the category set which is referenced by the pages this report would normally produce. I hope this is a very elegant solution as it allows you to use most of the existing selection criteria to define the (intermediate) page set which is then used to look for the categories. Some options do not make sense in that context but modt of them still are applicable. What do you think about this approach? Could you please test it (release 1.1.8)?

Gero 10:53, 12 May 2007 (CEST)
  • Looks good! I've been able to successfully nest calls to DPL (e.g. return the categories for a set of pages and then pass those categories back into another DPL call). Thanks. --Austin

Inverting "includematch"


It is easy with regex to match pages "which contain some word".(ie. /.*abc.*/s -> page which contain word "abc"). But it become complicated for generating list of "which page which doesn't contain word 'abc'".


How about adding new parameter "excludematch". So we can specify like


which should result a list of pages that contain word "abc" but doesn't contain word "def".

Temporary Code

For some one who need quick resolution, I just put some code here: Invertion of includematch. Cause this is a quick fix, rather than adding new parameter (excludematch), it work with special char preffix. For the sample on proposal, used this instead


The character "~" will convert the meaning of includematch to "which doesn't match". (BTW it also include a temporary fix for counter. see "List Counter doesn't work correctly" on DPL:Bug Reports Archive)


The feature has been added in 1.2.5; it is called 'includenotmatch', as it has to do with the inclusion of pages but the match operator is negated.

Gero 14:57, 20 July 2007 (CEST)

Test against MW 1.10


MW 1.10 is just out. Is there a way that this website gets upgraded so that DPL supports the latest MW version ?


There a no known problems with DPL under MW 1.10.

Add a parameter to SpecialPage to just show the output (without the DPL edit window)


  • The functionality below is great to insert links to the DPL special page, but it lacks an option for "dummy" users that just click on the link and want to see the output, not the DPL edit window.
  • A parameter just for the SpecialPage called "showDPLeditbox" would help getting that to work. Here is a fast crack at the functionality, but I am not really a PHP guy:
			$edit = 1;
			$wikitext .=      $wgRequest->getText('wikitext1') ? $wgRequest->getText('wikitext1') : str_replace( "&&", "\n", $par );
		    $wikitext .= "\n".$wgRequest->getText('wikitext2');
		    $wikitext .= "\n".$wgRequest->getText('wikitext3');
		    $wikitext .= "\n".$wgRequest->getText('wikitext4');
		    $wikitext .= "\n".$wgRequest->getText('wikitext5');
		    $wikitext .= "\n".$wgRequest->getText('wikitext6');
		    $wikitext .= "\n".$wgRequest->getText('wikitext7');
		    $cmds = split("\n",$wikitext);
		    foreach ($cmds as $cmd) {
			    if ($cmd=="") continue;
			    if (preg_match('/=\?/',$cmd)) continue;
			    if (preg_match('/^debug/',$cmd)) 	$wikitext=   $cmd."\n".$wikitext;
			    if (preg_match('/^noeditbox/',$cmd)) 	$edit=0;
			    else 							    $wikitext .= $cmd."\n";
	        $action = $mytitle->escapeLocalUrl();
		    if ($wikitext) {
			    if ($edit) {
		        $wgOut->addHTML("<form method='post' action=\"{$action}\">" . 
		                        "<textarea rows=8 name=wikitext1>$wikitext</textarea>" .
		                        "<input type='submit' value='" . wfMsg('dpl2_createreport')."' >" );
				$wgOut->addHtml("    <a href=../index.php/Special:DynamicPageListSP>reset</a>" .
		                        "</form>\n"); }


A good idea. It will find its way into Release 1.2.2. Gero 00:12, 22 June 2007 (CEST)

Invoke SpecialPage with Multiple Parameters


You might consider integrating the patch I propose in DPL:Manual - DPL Special Page with Parameters.


Thank you for this good idea! Your proposal will find its way into the next release. Gero 08:31, 26 May 2007 (CEST)

Add option to allow caching


I'd like to use DPL to build a lot of my page content without incurring as much of a performance hit with regards to caching. Since my generated content will rarely need to be updated (compared to many many views), it would be really nice if I could somehow keep page caching on and rely on action=purge to update the lists when needed.

My request/suggestion is to add something like an "allowCachedResults=true" option that simply causes DPL to skip any calls to disableCache for that particular tag evaluation.


There is only one call to parser->disableCache() and it is easy to switch it off via some parameter setting. But how can I test that it works? Which settings do you use in your LocalSettings.php? When I manually deactivated that call I could not see a faster delivery of normal pages, so I guess currently there is no caching in the dpldemo repository at all. What would one have to do to ENABLE caching? Gero 17:11, 30 April 2007 (CEST)

This site seemed to have caching on when I did some testing earlier. With this kind of change, you should be able to test by getting it to render outdated results versus up-to-date results. Have a page that uses DPL to list all articles that are in Category:Test, with "allowCachedResults=true". Then modify some other random page to add it to Category:Test, and view the first page again. If the cache is not disabled nor invalidated, you should see the outdated list without the additional page, and doing action=purge should give the up-to-date list. If it still appears that the cache is disabled, here are some things to check:
  • Go to Special:Preferences->Misc and make sure that "Disable page caching" is unchecked, or just log out of your user account while testing.
  • Make sure that your first page is not doing anything else that would naturally disable its caching (making other DPL calls without allowCachedResults=true, transcluding other pages with disabled caching).


Now there is such an option and it works as explained above. Gero 20:06, 2 May 2007 (CEST)

Include for a template could let you choose a single parameter to extract from the template


Re-injecting a template inside another template is great, but sometimes cumbersome if all you need is one parameter from the template. Couldn't there be just a simple way to extract ONE parameter from a template, without having to create a template a do so?


This is available with version 1.1.4. You can use "include={template}:name" or "include={template}:number" --Gero 13:59, 30 April 2007 (CEST)

suggestion: cleaner way to implement wfDynamicPageList4()


The function wfDynamicPageList4() is preceded by this comment:

// enumerating a fixed list of 20 parameters looks awkward but there seems to be no other way
function wfDynamicPageList4(&$parser, $p1= ,$p2= ,$p3= ,$p4= ,$p5= ,$p6= ,$p7= ,$p8= ,$p9= ,$p10=,
                             $p11=,$p12=,$p13=,$p14=,$p15=,$p16=,$p17=,$p18=,$p19=,$p20=) {

In fact, there is a better way. :) http://us2.php.net/manual/en/function.func-get-args.php

Maybe this is all you need?

function wfDynamicPageList4(&$parser) 
	$params = array();
	$numargs = func_num_args();
	if ($numargs < 2) {
	  $input = "#dpl: no arguments specified";
	  return str_replace('§','<','§pre>§nowiki>'.$input.'§/nowiki>§/pre>');
	// fetch all user-provided arguments (skipping $parser)
	$arg_list = func_get_args();
	for ($i = 1; $i < $numargs; $i++) {
	  $p1 = $arg_list[$i];
	  $input .= str_replace("\n",,$p1) ."\n";
	// for debugging you may want to uncomment the following statement
	//return str_replace('§','<','§pre>§nowiki>'.$input.'§/nowiki>§/pre>');
	return DynamicPageList( $input, $params, $parser );

Madkangas 03:01, 26 April 2007 (CEST)


Thank you very much! Help on the code is most welcome. Your suggestion will become part of the next release.

Gero 20:10, 26 April 2007 (CEST)

Statistics: Count articles in category or template inclusions


Instead of listing the articles a simple counter would be helpful sometimes. Similiar to {{NUMBEROFARTICLES}}, but customisable. Example: "There are XX articles in Category:Example". This might be nice for statistics. I don't know if that's not already possible somehow. --Matthias 15:54, 21 April 2007 (CEST)


I think you can do that already: See Test numberOfArticles. --Gero 19:21, 21 April 2007 (CEST)

Including sections by number


It would be useful if the includepage option could take a numbered section instead of a labeled section. That is, I might have a page where I don't know the name of the sections (and they aren't labeled) but I want to get a particular section (probably most commonly either the first or the last section).


Does it really make sense to show the 3rd paragraph of an article without even knowing the name of the headline? How should we count? Only level-2-headings? Or would we have to use TOC numbering like "3.4.7"? I doubt such a featrue would make a lot of sense as it would be very unstable in case somebody inserted a chapter somewhere in the article. Note that for example something like


will give a list of articles together with the first 300 characters of each article.

--Gero 19:42, 21 April 2007 (CEST)
  • Here's a concrete example of the use for this feature. Suppose you have a discussion page or even easier consider this very page with requests. Suppose you wanted to return the newest feature request (so basically the section at the top). You might have a lot of pages like this one and you want to have a page that shows the newest requests (first section) from across many pages. How can you do that without knowing what the name of section is (you can't predict what people will want to request)? You could have a label but then anytime someone added something, the label would have to be moved manually. In terms of specifying a section and levels, I would envision the easiest would be to use what MediaWiki already does. It appears to collapse all section levels and just count from the top. For example, if you hit the edit section link and look at the wpSection value, that's how the sections appear to be counted (also see the function Parser::getSection()). Returning the first n characters from a page might work in some cases but doesn't necessarily directly solve the example problem above. For example, even if the newest request was directly at the top of the page, if the newest request is < 300 characters, you only want to return that section rather than the first 300 characters of the page. So in terms of syntax, I'd think something like includepage=%1,%2 to include the first 2 sections of a page would be the simplest and most straightforward.
I am still not fully convinced - but you should have your chance ;-), Version 1.1.2 provides that feature, see the manual and Test include sections by number. Now it is up to you to come up with a brilliant website ... --Gero 21:57, 23 April 2007 (CEST)



Not sure if this is possible with DPL or not. On my wiki, I've used DPL to create lists on city pages: http://mographwiki.net/Category:Melbourne (You can see it lists "Companies" and "Freelancers"). I'd like to do the same thing for countries listing all the Companies and Freelancers in that country. For this to work, I'd need a list that requires the pages to be in a certain category (like Companies) and also be in a category which is a subcategory of the country in question (for example, Melbourne is a subcategory of Australia). Any ideas? Thanks!--Weakmassive 00:46, 17 April 2007 (CEST)


Could you - in principle - achieve your result by listing all the subcategories of Australia as an alternative besides Australia, i.e. "category=Australia|Sydney|Melbourne|Adelaide"? If the answer is yes one could maybe create a new option which explodes a category tree branch and replaces the name of the parent by the "parent plus all its children plus its (grand-)children etc.". -- 23:11, 17 April 2007 (CEST)

Ya, adding all the subcategories would achieve the same result - only lots more work. Your idea sounds like it would work, if someone could write it up. Thanks.--Weakmassive 23:53, 17 April 2007 (CEST)

Simple (preliminary) Solution

As a quick solution I added the "*" to category=; see the manual. The "*" currently covers only ONE level of hierarchy. More is hard to do ...
Please let us know if it works. --Gero 22:08, 18 April 2007 (CEST)

Awesome, thanks for adding that. I initially had problems with using "magic words" but figured out that you need to use the parser function syntax. All is well! Thanks again.--Weakmassive 00:28, 19 April 2007 (CEST)

Allow caching when using the title parameter


Is it feasible to avoid invoking disableCache whenever the title parameter is used? (and rely on the cache being invalidated when the transcluded page is edited) -- 21:45, 14 April 2007 (CEST)


An interesting suggestion. I uploaded release 1.1.0 which disables the cache only if 'title=' is NOT set. Could you please report your experience? I do not understand enough about mediawiki caching to make a thorough test.

--Gero 06:52, 16 April 2007 (CEST)

I am no expert myself, but it seems correct to me after reviewing mediawiki caching code. Basic testing also works as expected so far. -- 22:58, 16 April 2007 (CEST)

Returning non-existing pages


I would like an option to return pages that don't necessarily exist. For example, via linksfrom=Mypage. If Mypage has a wikilink to a non-existing page, the pagelinks table contains that link information but DPL does not return it because it does a join with the page table.


Now we have a new parameter called "openreferences". If set to "yes" a "linksfrom" will also show open references. Due to the missing target page we do not perform a join; as a consequence, however, there are several restrictions on which other parameters can be used together with this new option. See Test linksfrom.

Gero 18:53, 11 April 2007 (CEST)

General inversion


Is there a reason there isn't a notlinksfrom option (there's a notlinksto and I would assume it'd be basically the same)? More generally, why isn't there a 'not' version for all of the selectors? The main other one I don't see is nottitle (I can certainly imagine cases where I want to exclude a specific page).


Of course the concept of negation is general.

  1. The 'notlinksfrom' option is indeed missing. It will be supplied in one of the next releases (1.0.8).
  2. The 'title' option is different. We already have 'nottitlematch' and 'nottitleregexp' which allow to exclude articles based on simple name matching or even based on regular expressions. The 'title' option is a very special thing which allows DPL to be used as a (more flexible) substitute for another mediawiki extension named LabeledSectionTransclusion. See the description in the manual.
Gero 06:49, 9 April 2007 (CEST)

Extend the uses parameter to article headings and sections (like include)


It would be nice to be able to extend the "uses" criteria for page selection to whether or not an article contains a specific heading or section (lst). Another way would be to have a parameter that would be a strict about "includepage": if any of the required inclusions are missing, do not select the page. --Ycombarnous 12:03, 30 March 2007 (CEST)


There is an experimental new feature which allows to define regular expressions which must match included contents (parameter includematch). Please test and report your experience. Which behaviour would you expect if a page contained multiple chapters with identical name and only some of them match the condition? What happens if a chapter does not appear at all in the included page? Currently a regexp is applied to the OUTPUT of the DPL template (if you use template based inclusion). Would it be better to match the input (i.e. the calling location in the source file)?

--Gero 23:02, 31 March 2007 (CEST)

Template variable value filter

I think this one is hard to code, but here is what I would need:

On the interface list I would like a filter "Quellsystem=SAP", all other lines are not of interest.

Today I am using categories, which works fine, but this would be more flexible. --GunterS 15:47, 30 March 2007 (CEST)


There is an experimental new feature which allows to define regular expressions which must match included contents (parameter includematch). Please test and report your experience. Which behaviour would you expect if a page contained multiple chapters with identical name and only some of them match the condition?

I applied a "SAP" pattern to your test example. Does it now do what you had in mind?

--Gero 23:02, 31 March 2007 (CEST)

Thanks for your fast work. It is not exactly what I was hoping for, as the string only needs to appear in any of the output fields, not the exact field Quellsystem.
I can make an easy workaround by defining a new includepage, which adds an "_" (or any other character) before the value Quellsystem and than search vor "_SAP", which will find all relevant entries. So I say: good enough!

--GunterS 20:47, 2 April 2007 (CEST)


I changed the matching procedure to comply with your original reuqest as this is much more elegant. Now templates are checked against the code which invokes them. So you can write


But be careful: You normally will have to write something like


which means that you allow whitespace around the '=' and that you extend your matching beyond newline charcters.

Gero 13:16, 9 April 2007 (CEST)

Allow selections based on users who created or modified a page

It would be nice to restrict selections based on the authors of pages.


With version 1.0.5 we introduce a powerful set of such parameters.

--Gero 06:27, 31 March 2007 (CEST)

Calendar application based on DPL / parserfunctions / inputbox extension

Finally got it done!! You can test the application at Test calendar. There is a basic documentation on how to get it to work on any wiki.

Also added the page to the "test" category. --Ycombarnous 22:54, 28 March 2007 (CEST)

Update: I simplified the calendar so that twice less DPL calls are necessary. So it requires at most 31 DPL calls per month calendar (these are "light" calls). --Ycombarnous 14:09, 4 April 2007 (CEST)

Documentation for using DplLst as standalone parser ?


I would be interested to use your implementation of lst, in order to benefit from template parameter parsing in particular. If possible, could you make a small doc / examples on how to do an lst on a section or template ?

--Ycombarnous 13:50, 11 March 2007 (CET)


Feel free to reuse the code. I added some remarks in the code but do not have time for thorough documentation. You only have to add the tag definition (I wouldn´t use "lst" to avoid conflicts with an installed version of LabeledSectionTransclusion). I deleted these definitions to avoid such interference (you could make a diff with Steve´s source code ...).

An alternative is to use DPL as a very thin interface to the inclusion functionality. I could add a parameter for the article name which would do an exact comparison instead of a SQL LIKE match (this is more efficient). This could also implicitly switch to mode=userformat with all separators being empty. The result would be a fairly slim call, I think.

What exactly do you want to achieve?

--Gero 19:15, 12 March 2007 (CET)


Well, I would like to replace all the sections I have in my page by templates (much more flexible), and then use something like:

{{#lstt: article name|template_name|template_out}}

So basically, this is in DPL, but having it available for a single article with a compact call format would be great. I have to admit that template parameter re-injection is just a great thought!


We could have a parameter named "title" which accesses an article directly (quite efficient compared to SQL LIKE) and which implicitly sets "mode=userformat". And we could use "include" as an alias for "includepage" (just to make the notation shorter). You could then write:

{{#dpl:title=MyPage|include=#My Chapter}}

The advantage of this approach is that you could still use full dpl functionality, e.g. "multisecseparators" in case the same template is called more than once. Regarding the naming concept for the "alternate templates" I think the current mechanism of adding a suffix is quite natural and should stay as it is.

--Gero 10:03, 13 March 2007 (CET)

I agree on all line, that would be perfect. It would provide a replacement/enhancement to lst without conflict. --Ycombarnous 13:52, 13 March 2007 (CET)


O.K., the feature is available with version 1.0.1 as agreed. See Test title. Happy testing! If you find it useful and if it works stable could you please add a remark to the mediawiki.org page of the "LabeledSectionTransclusion" extension?

--Gero 14:50, 14 March 2007 (CET)

DPL could have a parameter to choose the maximum date of revision of pages to include


If we want a dynamic page list such as : "new articles on Berlin up to November 2005", it would be nice to have DPL search the latest revision of articles before date YYYY-MM-DD.

This is especially useful for people storing specs and interested into revisions of some articles at some point in time (like your source code for DPL stored on this site).

--Ycombarnous 10:23, 9 March 2007 (CET)


DPL 1.0.0 comes with four different possibilities for revision-related selection of pages. One of them does exactly what you proposed.

--Gero 10:42, 11 March 2007 (CET)

Fabulous! Thanks.

--Ycombarnous 13:23, 11 March 2007 (CET)


Would it be possible to include date ranges? Using the above example, "New articles on Berlin in 2005". The problem that I'm encountering currently with combining allrevisionsbefore and firstrevisionsince is that it appears that the firstrevisionsince is not being considered. Example ie: {{#dpl: category=random|firstrevisionsince = 2007|allrevisionsbefore = 2008}} returns everything in 'random', not just things in 'random' for the year 2007.

--Ratio 12:14, 12 June 2007 (CEST)


I changed the code to allow simultaneous conditions to be applied to revisions. Now you should be able to get the desired result. How do you think about this? Gero 08:10, 22 June 2007 (CEST)

Extension:DynamicPageList (DPL), version 3.2.1: Warning: No results.

Linksto parameter could have "AND/OR combinations" functionality as categories do


I am looking for articles that belong to 2 categories, and link to "link 1 or link2 or link3". I would like the order method to be linksto.

Answer (1)

Yes, a good idea, but this will take some time. One should be able to use logical expression with AND/OR/NOT/GROUPING for

  • category
  • linksto
  • uses
  • matches

The "not..." variants of these parameters could then become deprecated. Is anybody willing to help with implementing that functionality? -- Gero 10:53, 1 March 2007 (CET)

Answer (2)

For the moment I added "OR" grouping based on pipe separation for linksto, notlinksto, matches, notmatches, uses, notuses. Note that you cannot have more than one line for each of these parameters, i.e. there is no AND so far. -- Gero 09:51, 4 March 2007 (CET)

Allow other symbol for union of categories


It would be convenient to allow e.g. "\" for "|", so that in the case of using the parser function version, the "|" does not have to be written as "{{!}}". The "\" seems better than "/", which may occasionally occur in a category name.--Patrick 16:53, 15 February 2007 (UTC)


I will consider to use a general alias symbol for the pipe symbol which looks very similar : ¦ --Gero 09:28, 16 February 2007 (CET)

For readibility of wikitext that is better than {{!}}, but on many keyboards it is not available. There is often a key labeled like that, but giving "|".--Patrick 09:52, 16 February 2007 (CET)
I implemented "¦ aka |" in version 0.9.3 (the current version on this website) as an alternative for {{!}} and although I can see the problem of confusing "¦" with a standard "|" , I think it could be quite useful, even for wikipedia in general..
What do you think? --Gero 11:41, 16 February 2007 (CET)
Thanks. On my own installation I also added
// use the \ as a general alias for |
$input = str_replace('\\','|',$input); 
for easy typing. A backslash does not seem to conflict with anything, as long as category names do not contain a backslash, which does not seem wise anyway.--Patrick 09:54, 17 February 2007 (CET)
Did you check if \n still works as an alias for a newline character? If not there would still be the paragraph symbol ..
--Gero 12:20, 17 February 2007 (CET)
You are right, that does not work. Perhaps #or is a good extra possibility instead, with the code:
// use #or as a general alias for |
$input = str_replace('#or','|',$input); 
Patrick 15:00, 17 February 2007 (CET)
We could also look for mathematical symbols for intersection / union etc. and provide a more powerful syntax in general. But the problem with the pipe character must still be solved in a general way as it occurs also at other places, e.g. in listseparators= when you want to use wiki syntax to create a table layout in your DPL result.
--Gero 15:08, 17 February 2007 (CET)



date formatting


addeditdate et al. would be more versatile if they accepted not just "true", but actual date formating as options. e.g.

addeditdate="("F d")"

would give "(October 23)", per the relatively standard date formatting functions, ParserFunctions and php's date.


resolved; there is a new feature called "userdateformat" which gives you complete control over date formatting. It works as suggested. -- Gero 16:01, 26 February 2007 (CET)

search & replace for article titles


article titles could be changed in a systematic way (not the link target but the link label9


resolved with 1.0.0, see "replaceintitle" parameter --Gero 18:49, 12 March 2007 (CET)

repeated display if template is used multiple times in a page


When you use "includepage={MyTemplate} dpl" DPL only evaluates the first occurance of that template in the article.

We use repeated lists of the same template within one page. It would be nice if in this case the output table could repeat the article name and list the corresponding entries of the templates.

Answer (1)

This is a good suggestion. But there arise some questions: What should happen if you specify two or more expressions in the "includepage=" parameter? Producing a second result line would be confusing in this situation I think (and is general not the best approach as we have ordinal numbering for the result lines according to the number of articles found). Maybe it would be better just to paste all occurencies of your template together. In your template you could care for proper optical separation by putting a horizontal bar at the end... (This bar would also appear if there happens to be only one occurence of the template, but maybe you could add a variable in your template call to the FIRST occurence of the template; this variable could be ignored in your noirmal template an could be used to decide whether you have to output a separation line or not in the template which you use in the DPL report).

I am willing to find a good solution and suggest that you define an example on this website and describe the desired output. --(Gero) 17:29, 23 February 2007 (CET)

Answer (2)

Version 0.9.6 now has the ability to cope with multiple template calls and multiple identical chapter headings. A new parameter ("multisecseparators") can be used to define a separator which will be used for multiple identical sections. An example is available. -- Gero 16:23, 26 February 2007 (CET)

Thank you so much. I prepared another example. As you can see, it would be helpful on sorted tables if the [[%PAGE%]] parameter could be used as well. --GunterS 19:54, 6 March 2007 (CET)

It was only two lines of code that had to be changed. See patch 2 of DPL 0.9.9. Now your example looks much better... b.t.w: I always thought of software development repositories as a possible application field for DPL --Gero 20:35, 6 March 2007 (CET)

Answer (3)

In version 1.0.0 of DPL there is an additional possibility ("dominantsection") which does what you originally may have expected. It is not easy to understand but can be very useful sometimes, especially when creating sortable tables ... --Gero 10:42, 11 March 2007 (CET)

Make the Namespace optional


Thanks for updating DPL

Could you create a switch to disable the display of the namespace in %PAGE% as my category cloud looks a bit odd with category:item1 . category:item2 . category:item3 ......



I introduced with 0.9.6 a new variable called %TITLE% which contains the title of the page but not the namespace. So you can write [[%PAGE%|%TITLE]]. -- Gero 16:18, 26 February 2007 (CET)

Global Background-color


When I use the column or row parameters, the program will return tables by the number of column/row I set. May I set the global background-color to hide the table margin? Thank you very much.


{|width="100%" style="vertical-align:top;background-color:#f58ffa"
! <p style="margin:0; background-color:#cef2e0; font-size:120%; font-weight:bold;border:1px solid #a3bfb1;text-align:left;color:#000;padding:0.2em 0.4em;">Random Personal Pages</p>
  listseparators={|style="background-color:#f5fffa;" cellpadding=2 cellspacing=10, \n|-\n|width=30%|\n* [[%PAGE%]],, \n|}

Random Pages

Example (correct)

The code for constructing columns and rows can now be influenced by the user via rowcolformat; with this new parameter you get control over cellpadding, background-color etc.;

with rowcolformat=style="background-color:#f58ffa;" you get the desired result. Note that you need to download patch 1 of DPL 0.9.9.

Random Pages

btw: could you please add your site to the DPL:Websites using DPL? --Gero 17:35, 5 March 2007 (CET)

reply Thank you for your big big help. My site using the great DPL is in a LAN and never be linked from outside. Should I add a new item without link to the DPL:Websites using DPL? --Jessie

It would be nice if you gave us an example here, e.g. like GunterS has done; see Interface_list. --Gero 07:08, 8 March 2007 (CET)

Ancestry Function

DPL does a great job of listing all of the children of a category - all of the elements that belong to that category. It would be nice, however, to be able to determine the "parents", "grandparents", "greatgrandparents", etc of an element - the categories that the element belongs to.

I use categories, subcategories, sub-subcategories to help my users drill down into the content. A "reverse DPL" would let me put crumbs on each page to help the users find their way back out. Even if the function could only find one level of parents, it could be nested to find the next level. For instance, if

{{#dpl:element=current page|mode=reverse}}

gave the parent category of the current element, then

{{#dpl:element= {{#dpl:element=current page|mode=reverse}} |mode=reverse}}

would give the grandparent category of the current element, and so on.

Furboy 04:17, 15 March 2007 (CET)


DPL has the possibility to show all categories of a page, see the addcategories parameter. To demonstrate this feature I created a template called "Way up" which shows the category/categories of a page passed to the template. For "Fictitious country" a call will return Place.

So, if you pass the category of your page to this template you will get the ancestor. But you can do even better. If you put a call to that template into another template which assigns the "real" category to your page (called "is a", maybe), notation becomes very short: {{is a|Country}} would be sufficient to assign an article to the given category ("Country") and output a link to its ancestor category. Note that it is not possible to call dpl recursively using its output as an argument for another call. There are many technical reasons for that. So you have to live with one level of grandparents.

--Gero 20:40, 17 March 2007 (CET)

Wildcard Categories

It would be nice to be able to use wildcard characters in the category parameter. So, something like,

{{#dpl:category = Ethiopia*}}

would produce results for a category named Ethiopia, as well as for categories named Ethiopian, Ethiopians, etc.

Similarly, something like,

{{#dpl:category = (800) ###-####}}

would produce results for categories like (800) 555-1212, (800) 555-1234, and so on.

Furboy 04:40, 15 March 2007 (CET)


I think it is not too complicated to add something like "categorymatch=" and "notcategorymatch=" for traditional wildcard matching (SQL LIKE). For users with MySQL 5.x one could offer "categoryregexp=" and "notcategoryregexp=" in addition, which would allow to match numeric digits like in your (0800) example.

Gero 14:39, 15 March 2007 (CET)

Well, it´s already there. See Test regexp. Gero 15:32, 15 March 2007 (CET)

Labeled Section Transclusion Syntax

I understand that you adopted code for labeled section transclusion from the Labeled Section Transclusion extension, and that DPL uses the same LST syntax. Is it possible to revise the hooks in DPL to accept the same anchoring syntax that MediaWiki uses? LST and DPL currently look for hooks with syntax like:

<section begin=chapter1 />this is a chapter<section end=chapter1 />

For linking, MediaWiki uses either of the following:

<a name="Section_linking" id="Section_linking"></a>
<span id="anchor_name"></span>

Using the same conventions as MediaWiki is better for clarity (I don't have to keep track of what my anchor is for and whether I'm using the right syntax) and is better for economy (I don't have to include both MediaWiki anchors AND DPL anchors in a section that I want to both link to and transclude).

Furboy 06:38, 15 March 2007 (CET)

With the latest modifications DPL can more or less be used as a full substitution for LabeledSectionTransclusion, see #Documentation for using DplLst as standalone parser ? --Gero 07:15, 31 March 2007 (CEST)


DPL parses the WIKI text of articles which are transcluded, not their generated HTML output. Are you talking about users who write something like

<a name="Section_linking" id="Section_linking"></a>
<span id="anchor_name"></span>

into their documents?

--Gero 13:58, 15 March 2007 (CET)

islinkedto or linksfrom

I suggest a method islinkedto or linksfrom, ie islinkedto=foo only returns pages that foo links to. If Foo is a protected page, such as "Published" or "Approved" material, the resulting DPL will ensure some kind of quality control. I would really like it for my plan to run a collaborative podcast. I can't think of a better way to (a) provide some quality control and (b) provide some topic control, than to use DPLs. Thanks (Wikimedia user:pfctdayelise) 16:04, 28 March 2007 (CEST)

Perhaps a more intuitive name would be whatlinkshere . 16:06, 28 March 2007 (CEST)

I didn´t believe that this could be a useful feature. But, well, there it is (Test linksfrom). Try Version 1.04 and let us know whether it works. Is your site publicly available? --Gero 21:19, 28 March 2007 (CEST)

Dumb request ... ordered list 'offset' parameter?


I am integrating DPL with the inputbox extension on my site to give the illusion of allowing the user to 'fill in' the title of the latest page... http://funktopia.net/index.php/Template:FilmUpdates I would like the DPL to start the ordered list at element number 2 rather than 1 ... It it possible to have an 'oloffset' parameter? -- 13:20, 29 April 2007 (CEST)


There is a parameter called 'offset'. Use 'offset=1' and your list will start with the second entry. Gero 07:50, 30 April 2007 (CEST)

Hide the default article list on a category page


I am using DPL to create a list of articles in each category, and pull the description of each page from the template variables in each article. This is working perfectly but now I have 2 versions of the same lists, and it looks messy. A method (noCategoryList = true?) to hide the default list would be really handy.


Did you use 'mode=userformat' ? This is the general switch which switches off all default output... Gero 15:27, 8 July 2007 (CEST)