Difference between revisions of "DPL:Requests for new features"

From FollowTheScore
Jump to: navigation, search
(comment fix)
 
(112 intermediate revisions by 16 users not shown)
Line 1: Line 1:
__TOC__
+
----
 +
<big>
 +
This page is no longer in use. If you think one of the issues mentioned below is still relevant, go to [[:Category:Issue]] and create a new Issue (with type=''Change Request'' and status=''open'') there.
 +
</big>
 +
----
 +
 
  
::''Please add requests for new features <font color=red> at the beginning</font> of this document. If possible make syntax suggestions and give an example for the desired behaviour!''
+
__TOC__ __NEWSECTIONLINK__
  
 
::''Old requests (which have been resolved) can be found in the [[DPL:Requests for new features Archive]].
 
::''Old requests (which have been resolved) can be found in the [[DPL:Requests for new features Archive]].
Line 7: Line 12:
 
<!-- Please do not add/edit above this line ----------------------------------------------------------->
 
<!-- Please do not add/edit above this line ----------------------------------------------------------->
  
==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 [http://tnlc.com/eep/compare/table.html game comparison table] and need this functionality. -[[User:Eep²|Eep²]] 05:43, 29 July 2007 (CEST)
 
  
 +
==Include other wiki pages==
 +
I want to include parts of Wikipedia articles on my wiki. Can DPL be expanded to do this? -[[User:Eep²|Eep²]] 10:22, 20 August 2007 (CEST)
 +
 +
:I don´t think so. Every wiki has its own categories, templates, images,.... So just transcluding the raw text (if it is available via &action=view) would not make much sense. And transclusion of rendered html text is not possible nor desirable either. [[User:Gero|Gero]] 14:28, 20 August 2007 (CEST)
 +
 +
::And yet many websites (like http://encyclopedia.thefreedictionary.com/) do it all the time without any apparent problems (and there's even a [http://dev.wp-plugins.org/wiki/GetWIKI WordPress plugin])... All I really want to pull in is the first paragraph; I don't need templates, categories, or even images. Links can obviously be pulled in easily enough that go to the correct place (Wikipedia or external links). See http://www.killertux.com/pages/Wikipedia_Simple_API.php?q=node/44 too for a "screen scraper" with PHP code you may be able to implement in DPL. -[[User:Eep²|Eep²]] 15:19, 20 August 2007 (CEST)
 +
 +
:::Using the killertux API you can yourself include a whole wikipedia article into your wiki (as html or text). I can´t see what DPL should do in that context. DPL cannot and will not parse such scraped contents. You would have to build a completely separate and different mediawiki extension for that purpose. [[User:Gero|Gero]] 20:17, 22 August 2007 (CEST)
 +
 +
 +
== Most active page? ==
 +
ordermethod=activity
 +
 +
Most number of edits or biggest diffs in the last t units of time???
 +
 +
--[[User:Dmb|Dmb]] 18:11, 10 August 2007 (CEST)
 +
 +
:The sheer number of edits is not very meaningful; and as soon as 'significance of change' comes into play, I see no way to implement such a feature without having to calling diff3 on every document. And that is definitely too resource consuming. [[User:Gero|Gero]] 14:55, 15 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!
  
==Template field output==
+
--[[User:Dmb|Dmb]] 18:11, 10 August 2007 (CEST)
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. -[[User:Eep²|Eep²]] 06:56, 26 July 2007 (CEST)
 
  
 +
That´s a pretty good idea. Maybe I will add that somewhen. [[User:Gero|Gero]] 23:56, 10 August 2007 (CEST)
  
==User-friendlines==
+
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. --[[User:Dmb|Dmb]] 08:21, 14 August 2007 (CEST)
[[DPL talk:Manual - DPL Special Page with Parameters#User-friendliness]] -[[User:Eep²|Eep²]] 11:42, 25 July 2007 (CEST)
 
  
 +
:After some investigation I feel that it would be very slow and resource consuming to build that feature. '''If somebody can come up with a SQL statement''' which delivers the basic data we want to show: fine (I don´t know how to do it with pure SQL). Otherwise one would have to call diff3 for each document. That´s a show stopper. [[User:Gero|Gero]] 14:52, 15 August 2007 (CEST)
  
==Don't replace underscores by spaces==
+
:: Hello Gero, and sorry for taking so long to reply. Here is the SQL that I have come up with. I think that it does the job (more or less).
===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:
 
 
<pre>
 
<pre>
<DPL>
+
SELECT
category = functions
+
  rc_title, rc_cur_id, rc_user_text, rc_user,
replacespaces = true
+
  GROUP_CONCAT(rc_new_len - rc_old_len) AS DEBUG,
</DPL>
+
  SUM(ABS(rc_new_len - rc_old_len)) AS CONTRIB
</pre>
+
FROM
which would output:
+
db_prefix_categorylinks  cl
<pre>
+
INNER JOIN
* [[my_func]]
+
  db_prefix_recentchanges rc
* [[my_other_func]]
+
ON
</pre>
+
  cl.cl_from = rc.rc_cur_id
instead of:
+
WHERE
<pre>
+
  cl_to='Some_category'
* [[my func]]
+
GROUP BY
* [[my other func]]
+
  rc_cur_id, rc_user
 +
;
 
</pre>
 
</pre>
  
It would mean a great deal to me and the community. Thanks in advance.
+
Using the above we get to see which user has done the most 'editing' of a page in the given category. The notion of 'editing' implemented above is quite crude, but I can't think of any better systematic way to do it (SQL or otherwise). The contributors option would take a threshold parameter to delineate the valid list of 'significant contributors' - that parameter could even be a fraction of the page size! Anyway, lemmy know if this is what you were looking for, and if not why not.
 +
 
 +
Thanks for the brilliant extension!
 +
 
 +
P.S. I wonder if we could apply a modified version of the above to look at the 'most active pages' request above?
 +
 
 +
::--[[User:Dmb|Dmb]] 13:53, 14 September 2007 (CEST)
  
--[[User:Sandman|Sandman]] 02:39, 25 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 [http://tnlc.com/eep/compare/table.html game comparison table] and need this functionality. -[[User:Eep²|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. [[User:Gero|Gero]] 08:13, 29 July 2007 (CEST)
  
PS: If this can be setup somewhere in regular MediaWiki, please inform me of it.
+
::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 <tt>header</tt> (and <tt>column</tt>/<tt>row</tt> types). <tt>resultsfooter</tt> 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. <tt>cellseparators</tt> could be used instead of <tt>listseparators</tt> (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. -[[User:Eep²|Eep²]] 08:28, 29 July 2007 (CEST)
  
===Reply===
+
:::Still need this too... -[[User:Eep²|Eep²]] 05:40, 11 September 2007 (CEST)
Have you seen the 'replaceintitle' option? Maybe you could use 'mode=userformat' and <nowiki>[[%TITLE%]]</nowiki>. 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 [http://bugzilla.wikimedia.org/show_bug.cgi?id=9203 bugzilla]. Maybe you want to add a statement there?
+
==Template field output==
:[[User:Gero|Gero]] 05:33, 25 July 2007 (CEST)
+
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. -[[User:Eep²|Eep²]] 06:56, 26 July 2007 (CEST)
  
===Reply #2===
 
I created an article with underscores in its name. Normally this would give a result like
 
{{#dpl:titlematch=%underscore}}
 
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:
 
  
<nowiki><pre>
+
==User-friendlines==
<dpl>
+
[[DPL talk:Manual - DPL Special Page with Parameters#User-friendliness]] -[[User:Eep²|Eep²]] 11:42, 25 July 2007 (CEST)
  titlematch=%underscore
 
  replaceintitle=/ /,&#95;
 
</dpl>
 
</pre></nowiki>
 
It will produce the result
 
{{#dpl:titlematch=%underscore|replaceintitle=/ /,&#95;}}
 
And I guess, that´s what you wanted. This solution will also work with articles in all namespaces.
 
:[[User:Gero|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. ;-)
 
:--[[User:Sandman|Sandman]] 17:54, 25 July 2007 (CEST)
 
  
 
== Be PostgreSQL compliant ==
 
== Be PostgreSQL compliant ==
Line 85: Line 106:
 
I'd be curious if you consider this a feature request or a bug report&hellip;
 
I'd be curious if you consider this a feature request or a bug report&hellip;
  
 
== 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.
 
  
 
== rss feed from dpl ==
 
== rss feed from dpl ==
Line 113: Line 130:
 
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! --[[User:Dmb|Dmb]] 11:24, 1 June 2007 (CEST)
 
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! --[[User:Dmb|Dmb]] 11:24, 1 June 2007 (CEST)
  
==Create a special page for searching pages with DPL==
+
=== nudge ===
 +
Rss rss rss rss rss rss!!!
 +
 
 +
 
 +
== display Table of Contents for an article ==
 
===Request===
 
===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 incudepage feature could be enhanced to include the TOC only; a %TOC% variable would ebe useful ...
*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...
+
==Putting delimiters between results==
*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.
+
 
--[[User:Ycombarnous|Ycombarnous]] 14:55, 10 April 2007 (CEST)
+
::Will this solve a related formatting problem - putting delimiters only ''between'' results? Ideally I'd like to have a single result returned inline, but multiple results in an ordered list. It could be I misunderstood the documentation, but there doesn't seem to be a way to avoid a leading bullet or whatever in a list. [[User:Frank|Frank]] 14:35, 20 August 2007 (EDT)
===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. -- [[User:Gero|Gero]] 19:44, 21 April 2007 (CEST)
+
::: There is a mode called 'inline' which does what you want. You can define the 'inline' tag contents. [[User:Gero|Gero]] 07:50, 10 September 2007 (CEST)
 +
:::{{#dpl:category=Country|mode=inline|inlinetext= &nbsp; my separator &nbsp;}}
 +
 
 +
== 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?
 +
:[[User:Gero|Gero]] 21:05, 24 July 2007 (CEST)
 +
 
 +
== DPL API ==
 +
 
 +
I'd like to see more of an API structure to the code.  The [[DPL:Manual|manual]] lists all the parameters and groups them by functionality, but no such break-up exists in the code (at least not that I could tell).  At minimum, I'd like there be one function that processes the search criteria to get the results or groups of results in the form of an array of Title objects (or an array of arrays of title objects), and another function to display the results in a specified or default format.
 +
 
 +
I'd like to be able to build my own extension that uses the DPL2 extension as an API without having to hack the DPL2 code.  —[[User:Sledged|Sledged]] ([[User talk:Sledged|talk]]) 01:03, 10 September 2007 (CEST)
 +
 
 +
=== Reply ===
 +
 
 +
Why don´t you just go ahead with DPL as it is? You can put any call of a parser function into the output loop of DPL. And you can use DPL in a way that it does not produce any single byte of output on its own. You can easily create ''title objects'' within your code from the first parameter which is passed to ''my working template''. You might say that this is less efficient than an integration on php level but before trying to optimize you could build your extension right now without any change to DPL and without any code interference. '''What kind of application do you have in mind, by the way?.'''
 +
For example:
 +
<pre><nowiki>
 +
{{#dpl:
 +
  |resultsheader=²{my envelope template¦%PAGES%}²
 +
  |category=some category
 +
  |namespace=some namespace
 +
  |... etc
 +
  |format=,²{my working template¦%PAGE%¦%TITLE%}²
 +
}}
 +
</nowiki></pre>
 +
 
 +
--[[User:Gero|Gero]] 07:28, 10 September 2007 (CEST)
 +
 
 +
:I've been toying around with DPL a bit with some of the examples on this site, and I see now that it can do what I want it to do. Excellent!  I'm trying to be able to take user-supplied information from a page.  In fact, the table on the [[Main Page|main page]] with the headers "Country", "Area", "Population", "Text", and "#hits" is a perfect example of what I want to do. (The answer was in front of me all along.)
 +
 
 +
:I still would definitely like to see an API layout to the code, even more so now.  There are some really nice nuggets of functionality that would be useful as a suite of API tools and/or could be made into extensions in their own right, and if the code were in such a format, it'd be easier to pull out those bits of interest.
 +
 
 +
:In fact, I'd like to see the mechanic in the aforementioned example in a form I can use outside of DPL.  Also, I'd like to get my hands on that bit of code that utilizes the character escapes to prevent templates, magic words, tags, and other parser functions from being parsed before they're ready to be.  —[[User:Sledged|Sledged]] ([[User talk:Sledged|talk]]) 00:25, 15 September 2007 (CEST)
 +
 
 +
::I understand. In fact I had to solve a couple of hairy problems to offer the full power which DPL has right now. I suggest the following: You create one or more modular pieces by lending code from the current source. Thus we have one or more independently usable extensions/modules. Once they are tested and their interfaces have stabilized I will refactor the current DPL code to make use of the new module(s). Although this will create dependencies BETWEEN extensions I think it is the right way to go for. Before you start extracting pieces of the code you should wait for version 1.4.2 as it will have some interesting new features regarding table handling. Internally it tries to solve some really hard problems regarding interaction with the mediawiki parser and its book-keeping on references. [[User:Gero|Gero]] 09:12, 22 September 2007 (CEST)
 +
 
 +
:::Here's my first installment:  [[mw:Extension:Character Escapes|Character Escapes]].  I'm appalled at how simple that solution is and that no one has applied it to [http://meta.wikimedia.org/wiki/ParserFunctions ParserFunctions].  It doesn't use the escapes you've defined [[DPL:Manual - General Usage and Invocation Syntax#Characters with special meaning|here]], because it doesn't work well with heavy nesting.  So instead of trying to find a workaround with what you've defined, I used the convention commonly used in programming languages (i.e. the backslash).  —[[User:Sledged|Sledged]] ([[User talk:Sledged|talk]]) 06:50, 25 September 2007 (CEST)
 +
 
 +
==<tt>redirects</tt> include pages that ''link'' to redirects==
 +
See [[DPL:Discussion#Redirects to include pages that link to them?]] -[[User:Eep²|Eep²]] 05:07, 13 August 2007 (CEST)
 +
 
 +
:My final statement regarding this topic is in the [[DPL:FAQ|FAQ}}. [[User:Gero|Gero]] 10:31, 23 September 2007 (CEST)
 +
 
 +
::Can't you just add a simple parameter to <tt>redirects</tt> (like "<tt>strict</tt>") that does this automatically without requiring complicated nested queries? -[[User:Eep²|Eep²]] 10:39, 23 September 2007 (CEST)
 +
 
 +
==<tt>linksto</tt> and other parameter case-insensitivity option==
 +
I need this without having to manually specify lower-/upper-case versions of every page... -[[User:Eep²|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. [[User:Gero|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 <tt>$wgCapitalLinks = false;</tt> 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:
 +
 
 +
<pre><nowiki>
 +
|linksto={{FULLPAGENAME}}{{!}}{{FULLPAGENAME}}s{{!}}{{FULLPAGENAME}}es{{!}}{{FULLPAGENAME}}ies{{!}}{{FULLPAGENAME}}ing{{!}}{{FULLPAGENAME}}ed{{#if:{{{2}}}|{{!}}{{{2}}}{{!}}{{{2}}}s|}}
 +
</nowiki></pre>
 +
 
 +
::This query doesn't have any problem if any of these pagename variations don't exist so why would <tt>linksto</tt> 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 [http://tnlc.com/eep/compare/table.html comparison table])? It's like the [[#redirects include pages that link to redirects|<tt>redirect</tt> 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 <tt>titlematch</tt> 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... -[[User:Eep²|Eep²]] 15:38, 2 September 2007 (CEST)
 +
 
 +
::I really need this functionality, since trying to create case variations for all of the above redirect variations (PLUS creating the actual redirects!) is a tad big annoying... -[[User:Eep²|Eep²]] 05:40, 11 September 2007 (CEST)
 +
 
 +
::Hello? -[[User:Eep²|Eep²]] 12:40, 22 September 2007 (CEST)
 +
 
 +
:::Version 1.4.2 will have an 'ignorecase' switch. It will have an effect upon 'linksto', 'titlematch', and 'uses', but due to technical reasons not upon 'linksfrom' or any other DPL parameter. [[User:Gero|Gero]] 10:34, 23 September 2007 (CEST)
 +
 
 +
::::OK, thanks--better than nothing. ;) -[[User:Eep²|Eep²]] 10:39, 23 September 2007 (CEST)
 +
 
 +
== DPL doesn't respect $wgNonincludableNamespaces ==
 +
I'm using the [http://www.mediawiki.org/wiki/Extension:Lockdown Lockdown] extension to restrict read access to a certain namespace to one group of users only. Part of restricting read access is preventing page inclusion by namespace. DPL allows one to bypass this.
 +
 
 +
As a suggestion, if you're able to fix this, could you make it so that with DPL it'd be possible to include / transclude pages ''within'' a nonincludable namespace, but not ''across'' namespaces? E.g. if I set NS_PROJECT to be non-includable, it'd still be possible to include NS_PROJECT content on NS_PROJECT pages, but not on main namespace etc. pages.
 +
 
 +
Thanks. [[User:212.149.229.126|212.149.229.126]] 15:48, 11 September 2007 (CEST)
 +
 
 +
:Do you think that DPL is wide-spread enough so that it is worth the effort? Is Mediawiki as a whole going to offer consistent support for such protection mechanisms and more elaborated access rights? --[[User:Gero|Gero]] 22:07, 11 September 2007 (CEST)
 +
 
 +
::I have no idea how much effort would it take :) DPL's been actively developed for some time, so I thought I'd ask. I do realize Mediawiki isn't supposed to be a proper CMS with proper read access rules and so forth, so the private information wouldn't be ''that'' sensitive. In any case, it seems a bit too easy if it's accessible simply by using DPL. At the moment, there's no reason why I absolutely must use DPL, nor is there a reason why I absolutely must have read protected wiki pages. If the feature's very difficult to add, I'll just figure out which of the two, using DPL or having read restricticted wiki pages, save me more time. Thanks. [[User:212.149.229.126|212.149.229.126]] 22:58, 11 September 2007 (CEST)
 +
 
 +
 
 +
== Integrating templates==
 +
Hi Gero! By this time, if we want to collect data in many articles using a template, like [[Example 1]], we have to use the descriptions like followed:
 +
includepage={Country} dpl,#History,#Religion[20],revolution
 +
Could it be possible we could use them like followed:
 +
includepage={Country} __,name,capital,dial__,#History,#Religion[20],revolution
 +
or
 +
includepage={Country} {{{,name,capital,dial}}},#History,#Religion[20],revolution
 +
Then we would use [[Template:Catlist|Catlist]] to collect data.
 +
Because I am trying to develop the GUI of Catlist. Please see [[template:Catlist/test]]. I've added some elements like offset, include, table class and Title of column in it. But I still want to integreat all the templates in the one. The change which I ask for is come from new command [[Test table|table]].
  
*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. --[[User:Ycombarnous|Ycombarnous]] 10:32, 23 April 2007 (CEST)
+
By the way, I am afraid that [[template:Catlist/test]] use Get instead of Post. Could it be possible it would be disabled by passing too many data?
 +
Thank you!
 +
--[[User:Roc michael|Roc michael]] 04:32, 16 September 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 [http://openwetware.org/wiki/Special:Parse here] for an example. The source code is [http://openwetware.org/wiki/User:Austin/Extensions/SpecialParse here]. --Austin
+
::Gero, sorry! I'v seen the Eep²'s case like followed:
 +
|includepage={game}:year,{game}:genre,{game}:publisher,{game}:developer,{game}:engine,{game}:character
 +
::It also seems to be great!
 +
--[[User:Roc michael|Roc michael]] 13:39, 16 September 2007 (CEST)
  
----
+
:::Not really. As I've mentioned to Gero before (though I can't find where it's documented), it would be better if it could be declared like <tt>|includepage={game}:year,genre,publisher,developer,engine,character</tt> (or perhaps with colons vs. commas) without having to duplicate <tt>{game}</tt> for ''every'' parameter. -[[User:Eep²|Eep²]] 15:10, 16 September 2007 (CEST)
  
* This looks interesting, Austin! Maybe we can build a simple solution based on your extension --Gero 20:17, 26 April 2007 (CEST)
+
::::I have a tendency towards the following syntax:
 +
|include={myTemplate}:parm1:parm2:parm3
 +
::::it could behave like the parameter list in the 'table' statement. It would deliver each parameter as acolumn of a row. What do you think? [[User:Gero|Gero]] 17:30, 16 September 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)
+
:::::Sounds good. Would there be a way to optionally deliver each parameter as a row of a column too? I still want to have the option of column entries vs. row entries for [http://www.tnlc.com/wiki/index.php?title=Comparison_table my game comparison table] (so it doesn't become unnecessarily wide due to the amount of parameters--I'd rather have longer vertical scrolling)... -[[User:Eep²|Eep²]] 07:32, 17 September 2007 (CEST)
  
----
+
== You have %USER% and adduser=true, what about %AUTHOR% to go with addauthor and %EDITOR% to go with addlasteditor ? ==
  
* 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:
+
I realize that if addauthor = true, then %USER% is set to the author, but I want to create a table of data per page that includes both the most recent editor and the page author (first editor). For this we need the %AUTHOR% 'magic workd'.  
**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? --[[User:Ycombarnous|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.
+
Man ... so many things about DPL are confusing! I think the [[adduser]] option (first/last editor depending on ordermehtod) should be clarified wrt. [[addauthor]] and [[addlasteditor]]. The description of adduser actually talks about dates!
::Gero 20:10, 2 May 2007 (CEST)
 
  
=== Simple Forms extension ===
+
:-D --[[User:Dmb|Dmb]] 01:49, 17 September 2007 (CEST)
[http://www.mediawiki.org/wiki/Extension:Simple_Forms 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. [http://www.organicdesign.co.nz OrganicDesign] main page shows the example working. --[[User:Nad|Nad]] 03:31, 29 April 2007 (CEST)
 
  
== display Table of Contents for an article ==
+
== Specific enhancements for 'table from template' DPL ==
===Request===
 
the incudepage feature could be enhanced to include the TOC only; a %TOC% variable would ebe useful ...
 
  
==Better error handling==
+
I think a very commonly needed and natural use of the DPL is the 'table from template' DPL. I would like to suggest the following syntax to make it easier to generate such DPL output...
"%DPL-1.2.5-WARNING: No results!" is a tad bit vague (note the sarcasm). -[[User:Eep²|Eep²]] 12:40, 24 July 2007 (CEST)
 
:What do you expect instead? Did you notice the 'noresultsheader' option? [[User:Gero|Gero]] 20:30, 24 July 2007 (CEST)
 
  
::Something like "no <tt>noresultsheader</tt> 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)... -[[User:Eep²|Eep²]] 21:44, 24 July 2007 (CEST)
+
<pre>
 +
...
 +
incude = {Some template}:parameterOne
 +
incude = {Some template}:parameterTwo
 +
incude = {Some template}:parameterThree
 +
tablehead =  Title,            One,            Two,            Three
 +
tablebody = %TITLE%, %parameterOne%, %parameterTwo%, %parameterThree%
 +
...
 +
</pre>
  
== Output Format suited for SpecialExport ==
+
The above would generate a table of data for the named parameters passed to 'Template:Some template' in the included pages. I really really love the functions provided by DPL, I just find them hard to master! --[[User:Dmb|Dmb]] 18:53, 18 September 2007 (CEST)
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:
+
=== Reply ===
* User creates a DPL query on 'My Pages To Export'
+
That´s almost exactly what will be in the next version! But The syntax will look like this:
* User saves the page 'My Pages To Export'
+
<pre>
* User views the said page & 'cut and paste' the result from the view into 'Special:Export'
+
...
* User exports pages
+
include = {Some template}:parameterOne:parameterTwo:parameterThree
[[mw:user:jldupont]]
+
table  = ,, One, Two, Three
 +
</pre>
 +
Creating pseudo variables for each column would add new complexity which I try to avoid.
 +
:[[User:Gero|Gero]] 20:13, 18 September 2007 (CEST)
  
=== Reply (with example) ===
+
:: I understand why keeping complexity to a minimum is important, but the above solution (clean though it is) is very rigid compared to the flexibility afforded by the use of pseudo variables. Imagine the following, parameterOne is information about the category of the page that I would like to wrap <nowiki>[[:Category:%p1%]]</nowiki>, parameterTwo is an logo pointer that I would like to wrap <nowiki>[[Image:%p2%|200px]]</nowiki> and parameterThree is a website link that I would like to wrap <nowiki>[%p3% homepage]</nowiki>. None of this funn stuff is available via the above syntax (unless I am wrong). I can think of tons of examples where you just want the parameter, just like %TITLE% (or even %AUTHOR% or %EDITOR%). I am really enjoying watching DPL develope, and I realise that it is very easy for me to make suggestions without any clue regarding the underlying complexity, so sorry for sounding critical. The above is just an idea about what could be nice. All the best. --[[User:Dmb|Dmb]] 01:34, 19 September 2007 (CEST)
This should be fairly easy to do. Try something like <pre><nowiki>
+
::: No comment? --[[User:Dmb|Dmb]] 21:04, 19 September 2007 (CEST)
  {{#dpl:mode=userformat|titlematch=Ca%|listseparators=,\n %PAGE%,}}
+
:::: I´m afraid of the work ;-). The idea is very good, no doubt. Could you help with implementation? [[User:Gero|Gero]] 12:52, 20 September 2007 (CEST)
 +
::::: Sorry to hassle you about it, but I was keen to hear your opinion. I can certainly have a look at the source and let you know what I think. I am glad you like the idea :-D --[[User:Dmb|Dmb]] 21:10, 20 September 2007 (CEST)
 +
:::::: That was a real challenge but I think I can come up with a good solution. The next version will contain the following new feature:
 +
<pre><nowiki>
 +
include  = {template}:parm1:parm2:parm3,#some headline
 +
table    = (tableclass),(articlelink),colheader1,colheader2,colheader3,chapter title
 +
tablerow = [[%%|''%%'']],[[Image:%%|200px]],[%% homepage],'''%%'''
 
</nowiki></pre>
 
</nowiki></pre>
Note the leading colons and the slashes for subpages. I think you could paste this result directly into the export textarea.  
+
:::::: You will have access to transcluded contents via "%%". This will also be possible for transcluded paragraphs.
{{#dpl:mode=userformat|titlematch=Ca%|listseparators=,\n %PAGE%,}}
+
:::::: [[User:Gero|Gero]] 08:13, 22 September 2007 (CEST)
 +
 
 +
==Could I use DPL to collect all the parameters of a template in a list==
 +
HI! Gero.I want to use DPL to collect the parameters defined in a template ,by using a argument of DPL that would be called "temppar" or some what, with the result like followed:
 +
{| width=100%
 +
|width=50% align=center|
 +
<pre>
 +
*param 1
 +
*param 2
 +
*param 3
 +
*param 4
 +
*param...
 +
</pre>
 +
|align=center|
 +
{{#input: type = select
 +
| name = cars
 +
| multiple = 1 |
 +
*param 1
 +
*param 2
 +
*param 3
 +
*param 4
 +
*param 5
 +
}}
 +
|}
 +
Them I would use the result to make a multi-select in the [[Template:Catlist/test]] 'like followed' in the future. Do you think it is possible?--[[User:Roc michael|Roc michael]] 13:46, 19 September 2007 (CEST)
 +
 
 +
=== Reply ===
 +
I assume that you have many articles which use the same template (t1)? And you want to collect all values for one parameter (xx) of t1 which are used in the template invocations? You can do that with <tt>uses=Template:t1</tt> and <tt>include={t1}:xx</tt>. If it is not a named parameter you can use a number like this <tt>include={t1}:2</tt>. The <tt>format=,,\n,</tt> can be used to output only the values of 'xx' in the calls for 't1', not the article names. The problem is that your list will not be unique; it will contain the same entries as often as they occur in the template calls. Maybe you can find another extension which produces a unique list from a list with multiple identical entries. Probably you also want the paramneter values sorted by their value and not by the occurence in the template calls ...
 +
:[[User:Gero|Gero]] 18:50, 19 September 2007 (CEST)
 +
 
 +
:Gero, Yes, I want to use the parameters of DPL like <tt>uses=Template:t1</tt> and <tt>include={t1}:xx</tt>. But what I really want to do is to make a GUI to produce the code above. when users ,who don't know DPL Skill or who want to use  DPL function in convenient way, can dependent on it to query the results what they want directly or produce the different kind of DPL-query-strings. Maybe what I want is like followed not the above.
 +
{| width=100%
 +
|width=50% align=center|
 +
<pre>
 +
*param name1 of t1
 +
*param name2 of t1
 +
*param name3 of t1
 +
*param...
 +
</pre>
 +
|align=center|
 +
{{#input: type = select
 +
| name = cars
 +
| multiple = 1 |
 +
*param name1 of t1
 +
*param name2 of t1
 +
*param name3 of t1
 +
*param...
 +
}}
 +
|}
 +
:You are right. On the other hand, I really forget the existence of parameters like <nowiki>{{{1}}},{{{2}}}}</nowiki>, because I don't use them in a template for definition items very often. And they will be a hole of the selection items in my GUI. But since it is popular to definition items with named parameter in a template, I think it's worth to create a function to collect all the parameter names of a template. How do you think?
 +
::--[[User:Roc michael|Roc michael]] 01:44, 20 September 2007 (CEST)
 +
----
 +
I am still not sure whether I understand what you want:
 +
* Do you want to write a DPL query which extracts documentation (like parameter names) from templates?
 +
* Or do you want to analyse actual invocations of templates and find the values used for parameters?
 +
In the first case your template could use a NOINCLUDE section where it calls another template (maybe named 'tpldoc') to describe its parameters. That would be really nice but would require some effort from the authors of templates. 'tpldoc' together with the dpl query could work a little like javadoc..<br>
 +
Analysing the source code of a template just to find which parameters it uses would only give you parameter names, not their semantics. And the names could even be dynamically constructed like <nowiki>{{{{{{name}}}}}}</nowiki>.
 +
[[User:Gero|Gero]] 13:04, 20 September 2007 (CEST)
 +
 
 +
== Most popular page ==
 +
 
 +
'''Select by number of views during last n days.'''
 +
 
 +
This could be either used to generate most popular pages or in conjunction with other conditions to draw attention to not so often wisited pages from certain category etc.
 +
 
 +
:a) Please sign your contributions.
 +
:b) Is there a way to find out when a page has been visited via a SQL statement in wiki database?
 +
:[[User:Gero|Gero]] 10:37, 23 September 2007 (CEST)
 +
 
 +
== regex for category ==
 +
 
 +
Is it possible to use regular expressions for categories? A lot of my categories have highly structured names. [[User:Tobias Conradi|Tobias Conradi]] 21:08, 27 September 2007 (CEST)
 +
 
 +
:See [[categoryregexp]].
 +
:[[User:Gero|Gero]] 14:25, 3 October 2007 (CEST)
 +
 
 +
== headings ==
  
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..<br>
+
I am trying to use DPL as a more flexible version of [[mw:Extension:Labeled_Section_Transclusion|Labeled Section Transclusion]]. As such my request may not be of broad interest but here it is.
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]].
 
:[[User:Gero|Gero]] 20:51, 24 July 2007 (CEST)
 
  
== Hook based data exchange between extensions ==
+
I found no easy way to include the heading as part of the chapter include (i.e. the include=#... feature). The only way that worked for me was to wrap the section with <section begin="foo"/> and <section end="foo"/>. But then, the edit doesn't take the user to the correct place. I'd like the edit to take the user to edit the actual text seen--not the page where the transclusion code shows. --[[User:Matthew|Matthew]] 07:20, 9 October 2007 (CEST)
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.
+
:If you know the heading you can put it into the output stream yourself (using the <tt>format</tt> statement). If you include the chapter by its position the built-in variable %SECTION% will contain the section title. There is an [[Test include sections by number|example for this]].
[[mw:user:jldupont]]
+
:[[User:Gero|Gero]] 20:56, 9 October 2007 (CEST)
  
=== Reply ===
+
== No More Globals ==
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 ;-)
+
Since MediaWiki is slowly moving away from globals (see [http://www.mediawiki.org/wiki/Manual:Global_variables Manual:Global variables]), I recommend that DPL also migrate from both global variables and functions.  Static class members and methods are a reasonable alternative.  —[[User:Sledged|Sledged]] ([[User talk:Sledged|talk]]) 06:18, 10 October 2007 (CEST)
  
The problem of multiple contexts is also solved by extension nesting. Maybe you do a little exeprimenting and then come up with another comment?
+
----
:[[User:Gero|Gero]] 21:05, 24 July 2007 (CEST)
+
You are absolutely right. The code is not very well structured. It grew from an old simple implementation to a rather big piece of code. Although I think it is still maintainable I would prefer some restructuring. Quality of open source products comes from several authors contributing to the same source (ideally ..). Would you want to start the restructuring effort? You could download the current sources, make the appropriate changes and then upload again within a time frame of, say four weeks...
 +
[[User:Gero|Gero]] 08:39, 10 October 2007 (CEST)

Latest revision as of 19:11, 12 October 2007


This page is no longer in use. If you think one of the issues mentioned below is still relevant, go to Category:Issue and create a new Issue (with type=Change Request and status=open) there.



Old requests (which have been resolved) can be found in the DPL:Requests for new features Archive.


Include other wiki pages

I want to include parts of Wikipedia articles on my wiki. Can DPL be expanded to do this? -Eep² 10:22, 20 August 2007 (CEST)

I don´t think so. Every wiki has its own categories, templates, images,.... So just transcluding the raw text (if it is available via &action=view) would not make much sense. And transclusion of rendered html text is not possible nor desirable either. Gero 14:28, 20 August 2007 (CEST)
And yet many websites (like http://encyclopedia.thefreedictionary.com/) do it all the time without any apparent problems (and there's even a WordPress plugin)... All I really want to pull in is the first paragraph; I don't need templates, categories, or even images. Links can obviously be pulled in easily enough that go to the correct place (Wikipedia or external links). See http://www.killertux.com/pages/Wikipedia_Simple_API.php?q=node/44 too for a "screen scraper" with PHP code you may be able to implement in DPL. -Eep² 15:19, 20 August 2007 (CEST)
Using the killertux API you can yourself include a whole wikipedia article into your wiki (as html or text). I can´t see what DPL should do in that context. DPL cannot and will not parse such scraped contents. You would have to build a completely separate and different mediawiki extension for that purpose. Gero 20:17, 22 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)

The sheer number of edits is not very meaningful; and as soon as 'significance of change' comes into play, I see no way to implement such a feature without having to calling diff3 on every document. And that is definitely too resource consuming. Gero 14:55, 15 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)

After some investigation I feel that it would be very slow and resource consuming to build that feature. If somebody can come up with a SQL statement which delivers the basic data we want to show: fine (I don´t know how to do it with pure SQL). Otherwise one would have to call diff3 for each document. That´s a show stopper. Gero 14:52, 15 August 2007 (CEST)
Hello Gero, and sorry for taking so long to reply. Here is the SQL that I have come up with. I think that it does the job (more or less).
SELECT
  rc_title, rc_cur_id, rc_user_text, rc_user,
  GROUP_CONCAT(rc_new_len - rc_old_len) AS DEBUG,
  SUM(ABS(rc_new_len - rc_old_len)) AS CONTRIB
FROM
 db_prefix_categorylinks  cl
INNER JOIN
  db_prefix_recentchanges rc
ON
  cl.cl_from = rc.rc_cur_id
WHERE 
  cl_to='Some_category'
GROUP BY
  rc_cur_id, rc_user
;

Using the above we get to see which user has done the most 'editing' of a page in the given category. The notion of 'editing' implemented above is quite crude, but I can't think of any better systematic way to do it (SQL or otherwise). The contributors option would take a threshold parameter to delineate the valid list of 'significant contributors' - that parameter could even be a fraction of the page size! Anyway, lemmy know if this is what you were looking for, and if not why not.

Thanks for the brilliant extension!

P.S. I wonder if we could apply a modified version of the above to look at the 'most active pages' request above?

--Dmb 13:53, 14 September 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)
Still need this too... -Eep² 05:40, 11 September 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)


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…


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


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

Putting delimiters between results

Will this solve a related formatting problem - putting delimiters only between results? Ideally I'd like to have a single result returned inline, but multiple results in an ordered list. It could be I misunderstood the documentation, but there doesn't seem to be a way to avoid a leading bullet or whatever in a list. Frank 14:35, 20 August 2007 (EDT)
There is a mode called 'inline' which does what you want. You can define the 'inline' tag contents. Gero 07:50, 10 September 2007 (CEST)
Nig1  my separator  Nig2  my separator  Nig3  my separator  Nig4  my separator  Category:CountryA  my separator  Category:CountryB

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)

DPL API

I'd like to see more of an API structure to the code. The manual lists all the parameters and groups them by functionality, but no such break-up exists in the code (at least not that I could tell). At minimum, I'd like there be one function that processes the search criteria to get the results or groups of results in the form of an array of Title objects (or an array of arrays of title objects), and another function to display the results in a specified or default format.

I'd like to be able to build my own extension that uses the DPL2 extension as an API without having to hack the DPL2 code. —Sledged (talk) 01:03, 10 September 2007 (CEST)

Reply

Why don´t you just go ahead with DPL as it is? You can put any call of a parser function into the output loop of DPL. And you can use DPL in a way that it does not produce any single byte of output on its own. You can easily create title objects within your code from the first parameter which is passed to my working template. You might say that this is less efficient than an integration on php level but before trying to optimize you could build your extension right now without any change to DPL and without any code interference. What kind of application do you have in mind, by the way?. For example:

{{#dpl:
  |resultsheader=²{my envelope template¦%PAGES%}²
  |category=some category
  |namespace=some namespace
  |... etc
  |format=,²{my working template¦%PAGE%¦%TITLE%}²
}}

--Gero 07:28, 10 September 2007 (CEST)

I've been toying around with DPL a bit with some of the examples on this site, and I see now that it can do what I want it to do. Excellent! I'm trying to be able to take user-supplied information from a page. In fact, the table on the main page with the headers "Country", "Area", "Population", "Text", and "#hits" is a perfect example of what I want to do. (The answer was in front of me all along.)
I still would definitely like to see an API layout to the code, even more so now. There are some really nice nuggets of functionality that would be useful as a suite of API tools and/or could be made into extensions in their own right, and if the code were in such a format, it'd be easier to pull out those bits of interest.
In fact, I'd like to see the mechanic in the aforementioned example in a form I can use outside of DPL. Also, I'd like to get my hands on that bit of code that utilizes the character escapes to prevent templates, magic words, tags, and other parser functions from being parsed before they're ready to be. —Sledged (talk) 00:25, 15 September 2007 (CEST)
I understand. In fact I had to solve a couple of hairy problems to offer the full power which DPL has right now. I suggest the following: You create one or more modular pieces by lending code from the current source. Thus we have one or more independently usable extensions/modules. Once they are tested and their interfaces have stabilized I will refactor the current DPL code to make use of the new module(s). Although this will create dependencies BETWEEN extensions I think it is the right way to go for. Before you start extracting pieces of the code you should wait for version 1.4.2 as it will have some interesting new features regarding table handling. Internally it tries to solve some really hard problems regarding interaction with the mediawiki parser and its book-keeping on references. Gero 09:12, 22 September 2007 (CEST)
Here's my first installment: Character Escapes. I'm appalled at how simple that solution is and that no one has applied it to ParserFunctions. It doesn't use the escapes you've defined here, because it doesn't work well with heavy nesting. So instead of trying to find a workaround with what you've defined, I used the convention commonly used in programming languages (i.e. the backslash). —Sledged (talk) 06:50, 25 September 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)

My final statement regarding this topic is in the [[DPL:FAQ|FAQ}}. Gero 10:31, 23 September 2007 (CEST)
Can't you just add a simple parameter to redirects (like "strict") that does this automatically without requiring complicated nested queries? -Eep² 10:39, 23 September 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:
	 
|linksto={{FULLPAGENAME}}{{!}}{{FULLPAGENAME}}s{{!}}{{FULLPAGENAME}}es{{!}}{{FULLPAGENAME}}ies{{!}}{{FULLPAGENAME}}ing{{!}}{{FULLPAGENAME}}ed{{#if:{{{2}}}|{{!}}{{{2}}}{{!}}{{{2}}}s|}}	
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)
I really need this functionality, since trying to create case variations for all of the above redirect variations (PLUS creating the actual redirects!) is a tad big annoying... -Eep² 05:40, 11 September 2007 (CEST)
Hello? -Eep² 12:40, 22 September 2007 (CEST)
Version 1.4.2 will have an 'ignorecase' switch. It will have an effect upon 'linksto', 'titlematch', and 'uses', but due to technical reasons not upon 'linksfrom' or any other DPL parameter. Gero 10:34, 23 September 2007 (CEST)
OK, thanks--better than nothing. ;) -Eep² 10:39, 23 September 2007 (CEST)

DPL doesn't respect $wgNonincludableNamespaces

I'm using the Lockdown extension to restrict read access to a certain namespace to one group of users only. Part of restricting read access is preventing page inclusion by namespace. DPL allows one to bypass this.

As a suggestion, if you're able to fix this, could you make it so that with DPL it'd be possible to include / transclude pages within a nonincludable namespace, but not across namespaces? E.g. if I set NS_PROJECT to be non-includable, it'd still be possible to include NS_PROJECT content on NS_PROJECT pages, but not on main namespace etc. pages.

Thanks. 212.149.229.126 15:48, 11 September 2007 (CEST)

Do you think that DPL is wide-spread enough so that it is worth the effort? Is Mediawiki as a whole going to offer consistent support for such protection mechanisms and more elaborated access rights? --Gero 22:07, 11 September 2007 (CEST)
I have no idea how much effort would it take :) DPL's been actively developed for some time, so I thought I'd ask. I do realize Mediawiki isn't supposed to be a proper CMS with proper read access rules and so forth, so the private information wouldn't be that sensitive. In any case, it seems a bit too easy if it's accessible simply by using DPL. At the moment, there's no reason why I absolutely must use DPL, nor is there a reason why I absolutely must have read protected wiki pages. If the feature's very difficult to add, I'll just figure out which of the two, using DPL or having read restricticted wiki pages, save me more time. Thanks. 212.149.229.126 22:58, 11 September 2007 (CEST)


Integrating templates

Hi Gero! By this time, if we want to collect data in many articles using a template, like Example 1, we have to use the descriptions like followed:

includepage={Country} dpl,#History,#Religion[20],revolution

Could it be possible we could use them like followed:

includepage={Country} __,name,capital,dial__,#History,#Religion[20],revolution

or

includepage={Country} {{{,name,capital,dial}}},#History,#Religion[20],revolution

Then we would use Catlist to collect data. Because I am trying to develop the GUI of Catlist. Please see template:Catlist/test. I've added some elements like offset, include, table class and Title of column in it. But I still want to integreat all the templates in the one. The change which I ask for is come from new command table.

By the way, I am afraid that template:Catlist/test use Get instead of Post. Could it be possible it would be disabled by passing too many data? Thank you! --Roc michael 04:32, 16 September 2007 (CEST)

Gero, sorry! I'v seen the Eep²'s case like followed:
|includepage={game}:year,{game}:genre,{game}:publisher,{game}:developer,{game}:engine,{game}:character
It also seems to be great!

--Roc michael 13:39, 16 September 2007 (CEST)

Not really. As I've mentioned to Gero before (though I can't find where it's documented), it would be better if it could be declared like |includepage={game}:year,genre,publisher,developer,engine,character (or perhaps with colons vs. commas) without having to duplicate {game} for every parameter. -Eep² 15:10, 16 September 2007 (CEST)
I have a tendency towards the following syntax:
|include={myTemplate}:parm1:parm2:parm3
it could behave like the parameter list in the 'table' statement. It would deliver each parameter as acolumn of a row. What do you think? Gero 17:30, 16 September 2007 (CEST)
Sounds good. Would there be a way to optionally deliver each parameter as a row of a column too? I still want to have the option of column entries vs. row entries for my game comparison table (so it doesn't become unnecessarily wide due to the amount of parameters--I'd rather have longer vertical scrolling)... -Eep² 07:32, 17 September 2007 (CEST)

You have %USER% and adduser=true, what about %AUTHOR% to go with addauthor and %EDITOR% to go with addlasteditor ?

I realize that if addauthor = true, then %USER% is set to the author, but I want to create a table of data per page that includes both the most recent editor and the page author (first editor). For this we need the %AUTHOR% 'magic workd'.

Man ... so many things about DPL are confusing! I think the adduser option (first/last editor depending on ordermehtod) should be clarified wrt. addauthor and addlasteditor. The description of adduser actually talks about dates!

-D --Dmb 01:49, 17 September 2007 (CEST)

Specific enhancements for 'table from template' DPL

I think a very commonly needed and natural use of the DPL is the 'table from template' DPL. I would like to suggest the following syntax to make it easier to generate such DPL output...

...
incude = {Some template}:parameterOne
incude = {Some template}:parameterTwo
incude = {Some template}:parameterThree
tablehead =  Title,            One,            Two,            Three
tablebody = %TITLE%, %parameterOne%, %parameterTwo%, %parameterThree%
...

The above would generate a table of data for the named parameters passed to 'Template:Some template' in the included pages. I really really love the functions provided by DPL, I just find them hard to master! --Dmb 18:53, 18 September 2007 (CEST)

Reply

That´s almost exactly what will be in the next version! But The syntax will look like this:

...
include = {Some template}:parameterOne:parameterTwo:parameterThree
table   = ,, One, Two, Three

Creating pseudo variables for each column would add new complexity which I try to avoid.

Gero 20:13, 18 September 2007 (CEST)
I understand why keeping complexity to a minimum is important, but the above solution (clean though it is) is very rigid compared to the flexibility afforded by the use of pseudo variables. Imagine the following, parameterOne is information about the category of the page that I would like to wrap [[:Category:%p1%]], parameterTwo is an logo pointer that I would like to wrap [[Image:%p2%|200px]] and parameterThree is a website link that I would like to wrap [%p3% homepage]. None of this funn stuff is available via the above syntax (unless I am wrong). I can think of tons of examples where you just want the parameter, just like %TITLE% (or even %AUTHOR% or %EDITOR%). I am really enjoying watching DPL develope, and I realise that it is very easy for me to make suggestions without any clue regarding the underlying complexity, so sorry for sounding critical. The above is just an idea about what could be nice. All the best. --Dmb 01:34, 19 September 2007 (CEST)
No comment? --Dmb 21:04, 19 September 2007 (CEST)
I´m afraid of the work ;-). The idea is very good, no doubt. Could you help with implementation? Gero 12:52, 20 September 2007 (CEST)
Sorry to hassle you about it, but I was keen to hear your opinion. I can certainly have a look at the source and let you know what I think. I am glad you like the idea :-D --Dmb 21:10, 20 September 2007 (CEST)
That was a real challenge but I think I can come up with a good solution. The next version will contain the following new feature:
 include  = {template}:parm1:parm2:parm3,#some headline
 table    = (tableclass),(articlelink),colheader1,colheader2,colheader3,chapter title
 tablerow = [[%%|''%%'']],[[Image:%%|200px]],[%% homepage],'''%%'''
You will have access to transcluded contents via "%%". This will also be possible for transcluded paragraphs.
Gero 08:13, 22 September 2007 (CEST)

Could I use DPL to collect all the parameters of a template in a list

HI! Gero.I want to use DPL to collect the parameters defined in a template ,by using a argument of DPL that would be called "temppar" or some what, with the result like followed:

*param 1
*param 2
*param 3
*param 4
*param...

{{#input: type = select

name = cars
  • param 1
  • param 2
  • param 3
  • param 4
  • param 5

}}

Them I would use the result to make a multi-select in the Template:Catlist/test 'like followed' in the future. Do you think it is possible?--Roc michael 13:46, 19 September 2007 (CEST)

Reply

I assume that you have many articles which use the same template (t1)? And you want to collect all values for one parameter (xx) of t1 which are used in the template invocations? You can do that with uses=Template:t1 and include={t1}:xx. If it is not a named parameter you can use a number like this include={t1}:2. The format=,,\n, can be used to output only the values of 'xx' in the calls for 't1', not the article names. The problem is that your list will not be unique; it will contain the same entries as often as they occur in the template calls. Maybe you can find another extension which produces a unique list from a list with multiple identical entries. Probably you also want the paramneter values sorted by their value and not by the occurence in the template calls ...

Gero 18:50, 19 September 2007 (CEST)
Gero, Yes, I want to use the parameters of DPL like uses=Template:t1 and include={t1}:xx. But what I really want to do is to make a GUI to produce the code above. when users ,who don't know DPL Skill or who want to use DPL function in convenient way, can dependent on it to query the results what they want directly or produce the different kind of DPL-query-strings. Maybe what I want is like followed not the above.
*param name1 of t1
*param name2 of t1
*param name3 of t1
*param...

{{#input: type = select

name = cars
  • param name1 of t1
  • param name2 of t1
  • param name3 of t1
  • param...

}}

You are right. On the other hand, I really forget the existence of parameters like {{{1}}},{{{2}}}}, because I don't use them in a template for definition items very often. And they will be a hole of the selection items in my GUI. But since it is popular to definition items with named parameter in a template, I think it's worth to create a function to collect all the parameter names of a template. How do you think?
--Roc michael 01:44, 20 September 2007 (CEST)

I am still not sure whether I understand what you want:

  • Do you want to write a DPL query which extracts documentation (like parameter names) from templates?
  • Or do you want to analyse actual invocations of templates and find the values used for parameters?

In the first case your template could use a NOINCLUDE section where it calls another template (maybe named 'tpldoc') to describe its parameters. That would be really nice but would require some effort from the authors of templates. 'tpldoc' together with the dpl query could work a little like javadoc..
Analysing the source code of a template just to find which parameters it uses would only give you parameter names, not their semantics. And the names could even be dynamically constructed like {{{{{{name}}}}}}. Gero 13:04, 20 September 2007 (CEST)

Most popular page

Select by number of views during last n days.

This could be either used to generate most popular pages or in conjunction with other conditions to draw attention to not so often wisited pages from certain category etc.

a) Please sign your contributions.
b) Is there a way to find out when a page has been visited via a SQL statement in wiki database?
Gero 10:37, 23 September 2007 (CEST)

regex for category

Is it possible to use regular expressions for categories? A lot of my categories have highly structured names. Tobias Conradi 21:08, 27 September 2007 (CEST)

See categoryregexp.
Gero 14:25, 3 October 2007 (CEST)

headings

I am trying to use DPL as a more flexible version of Labeled Section Transclusion. As such my request may not be of broad interest but here it is.

I found no easy way to include the heading as part of the chapter include (i.e. the include=#... feature). The only way that worked for me was to wrap the section with <section begin="foo"/> and <section end="foo"/>. But then, the edit doesn't take the user to the correct place. I'd like the edit to take the user to edit the actual text seen--not the page where the transclusion code shows. --Matthew 07:20, 9 October 2007 (CEST)

If you know the heading you can put it into the output stream yourself (using the format statement). If you include the chapter by its position the built-in variable %SECTION% will contain the section title. There is an example for this.
Gero 20:56, 9 October 2007 (CEST)

No More Globals

Since MediaWiki is slowly moving away from globals (see Manual:Global variables), I recommend that DPL also migrate from both global variables and functions. Static class members and methods are a reasonable alternative. —Sledged (talk) 06:18, 10 October 2007 (CEST)


You are absolutely right. The code is not very well structured. It grew from an old simple implementation to a rather big piece of code. Although I think it is still maintainable I would prefer some restructuring. Quality of open source products comes from several authors contributing to the same source (ideally ..). Would you want to start the restructuring effort? You could download the current sources, make the appropriate changes and then upload again within a time frame of, say four weeks... Gero 08:39, 10 October 2007 (CEST)