DPL:Requests for new features

From FollowTheScore
Revision as of 22:53, 14 August 2007 by Gero (talk | contribs) (Request)
Jump to: navigation, search
Please add requests for new features at the beginning of this document. If possible make syntax suggestions and give an example for the desired behaviour!
Old requests (which have been resolved) can be found in the DPL:Requests for new features Archive.

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 212.204.157.222 (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)

Most active page?

ordermethod=activity

Most number of edits or biggest diffs in the last t units of time???

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


Add 'contributors'?

addcontributors = TRUE contribthresh = x Kb

Instead of listing one page author or the last editor, addcontributor would add the users who had made significant diffs to the article, where significant is determined by contribthresh. The multiple names are listed separated by commas.

Woop!

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

That´s a pretty good idea. Maybe I will add that somewhen. Gero 23:56, 10 August 2007 (CEST)

I also thought of another idea... List users by total contrib size. Its a bit 'lets see who has the biggest penis' - but could be useful to see who has contributed most to a certain page or category. --Dmb 08:21, 14 August 2007 (CEST)

Template call escaping in output

Example:

...
|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. - 82.252.29.95 16:49, 10 August 2007 (CEST)

The next DPL release 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)


<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:

<noinclude>[[Category:News]]</noinclude>

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)

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)


Table row/column header switch

Can the table headers be used as the beginning of rows instead of at the top of columns? I would like to duplicate my game comparison table and need this functionality. -Eep² 05:43, 29 July 2007 (CEST)

Please give more details: How should the new switch be named, which values be allowed? In which modes should it have an effect and how should the result be affected?
For information: There will be no changes to the DPL sources within the next three weeks. Gero 08:13, 29 July 2007 (CEST)
I'm not a programmer, Gero...I just have ideas and what I want to do programmatically that I can already do (and have done for years) manually. Perhaps creating a "table" mode that deals with all table-related parameters like header (and column/row types). resultsfooter could have an option to be the last row or column of the table and include parameters for totals of a specific header (# articles in table, etc), a number field (like a "sum" function), etc. cellseparators could be used instead of listseparators (or at least as an alias) and. of course, support for specifying normal/regular non-suffixed template fields. Essentially, DPL needs more table-specific support to move it beyond just lists, per se. -Eep² 08:28, 29 July 2007 (CEST)


Template field output

Is it possible to output the unescaped wikimarkup (so it actually works as on pages that use the template) in DPL output? I want to create a DPL table that has same links as articles do that use the template in them which is also called in the DPL table. -Eep² 06:56, 26 July 2007 (CEST)


User-friendlines

DPL talk:Manual - DPL Special Page with Parameters#User-friendliness -Eep² 11:42, 25 July 2007 (CEST)


Don't replace underscores by spaces

Request

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:

<DPL>
category = functions
replacespaces = true
</DPL>

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.

Reply

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)

Response

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)

Be PostgreSQL compliant

Request

As of DPL 1.1.7, usage of DPL in a PostgreSQL-based MediaWiki requires further effort, which I describe in DPL:Manual - DPL with PostgreSQL.

  • I don't know if there is a common syntax between MySQL and PostgreSQL for the database functions - if not, my solution is easy to install.
  • But the need for a patch is really nasty. I think with my patch, DPL still works with MySQL as well. If so, could you kindly incorporate it.

I'd be curious if you consider this a feature request or a bug report…


Multiple columns with headingmode

Request

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.

Response

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)

rss feed from dpl

Request

A DPL might also have an according RSS feed. For example, a calendar might give a feed with the upcoming events from now on. --Eiland 09:30, 16 April 2007 (CEST).

Response

I haven´t worked with RSS generation so far. Is there a php library or a mediwiki module for that purpose? --Gero 22:08, 23 April 2007 (CEST)

Plenty of MediaWiki Extensions for RSS... should be easy to integrate with DPL :) --141.14.26.126 13:16, 29 April 2007 (CEST)
Which one would you suggest? Can you do the integration? Gero 20:12, 2 May 2007 (CEST)

Request

I have a similar request... Make each DPL into an RSS feed! --Dmb 11:20, 1 June 2007 (CEST)

Wait... that was me talking ... I just recognized my IP... (oh my memory!)

Well... you could start by looking here...

  1. http://meta.wikimedia.org/wiki/User:Mafs/RSS
  2. http://meta.wikimedia.org/wiki/RSS_into_Wiki
  3. http://www.mediawiki.org/wiki/GISWiki/RSS

That should certainly help with the details. Unfortunately I cannot do the integration myself or I would happily do it immediately. Thanks for the brilliant product and keep up the good work! --Dmb 11:24, 1 June 2007 (CEST)

nudge

Rss rss rss rss rss rss!!!

Create a special page for searching pages with DPL

Request

  • 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)

Reply

  • 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)

display Table of Contents for an article

Request

the incudepage feature could be enhanced to include the TOC only; a %TOC% variable would ebe useful ...

Better error handling

"%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)

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

mw:user:jldupont

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
Calendar
Cameroon
Talk:Calendar zh-tw
Talk:Call extension
Talk:Cache API
Talk:Calendar
User:Capmo
User talk:Capmo
:File:Calendarerror.jpg
:File:Catlist error msg 001.png
:File:Calendar templates-20071124.xml
Template:Calendar link zh-tw
Template:Car.list
Template:Calendar navigation
Template:Category with count
Template:CatTreeSub
Template:Calendar anchor
Template:Category handler/numbered
Template:Car
Template:CatTree
Template:Calendar/MonthStartThu
Template:Calendar/MonthStartTue
Template:Calendar/MonthStartWed
Template:Calendar/MonthStartFri
Template:CategoryGallery
Template:Calendar/MonthStartMon
Template:Calendar/MonthStartSat
Template:Calendar/MonthStartSun
Template:Category handler/blacklist
Template:Calendar link
Template:Calendar month
Template:Calendar month zh-tw
Template:Category handler
Template:CalendarSingle
Template:Catgraph
Template:CalendarSingle zh-tw
Template:Catlist1
Template:Catlist
Template:Catlist zh
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:Café
:Category:Cat 2
:Category:Cat 1
:Category:Cat 11
:Category:Cat 12
:Category:Car
:Category:Category
:Category:Café d'Anvers
:Category:Calendar Templates
DPL:Catlist
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:Caching
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)

Hook based data exchange between extensions

Would it be possible to add a 'hook' (i.e. wfRunHooks) to DPL? Once a 'query' is finished executing, the result could be signaled to other interested extensions. A 'context id' would be required as potentially many queries could co-exist on the same page. I would suggest adding a parameter such as 'context=' OR just a linear incremental counter.

A 'no output' option would be great also - this way, if the query is really meant to be consumed by another extension, the user isn't distracted by the result from DPL directly. mw:user:jldupont

Reply

I do not have experience with creating hooks. There is a point in the code where the sql result set is ready. But be warned: The columns contained in the result set may vary depending on the options used. Generally speaking, DPL is a beast that has reached its saturation level of complexity ;-). I would more be in favour of a way where DPL produces some kind of csv output which is then fed into another extension. With mode=userformat this is fairly easy because you have complete control over the output. You can create csv or whatever format suits your own extension. This need not be wikitext nor need it be html or plain text - any kind of grammar is possible. For example you can use the result of one DPL statement as a parameter for another one, i.e. you can nest DPL calls. There is a good example for this: Wgraph:Example 4. Here the inner DPL query produces a pipe-separated list for the outer one.

So, the 'no output' you are looking for is already there. It´s called mode=userformat -- and it will take you some time to understand its power. Being the author I am still myself learning what you can do with DPL ;-)

The problem of multiple contexts is also solved by extension nesting. Maybe you do a little exeprimenting and then come up with another comment?

Gero 21:05, 24 July 2007 (CEST)