DPL talk:Manual - DPL parameters: Criteria for page selection

From FollowTheScore
Jump to: navigation, search

Turning timestamp/editor off?

I'm using the DPL parameter "firstrevisionsince=dateandoptionaltime" , to display articles after 20080430. One results is as follows: 23:57, 2 May 2008 : Insurance Programs . . JSmith --- I would like for the end result to be: Insurance Programs --Displaying only the article and removing the timestamp and the editor's name. How can I turn the timestamp/editor results off?

Use format. Thus you can customize your output completely. Gero 23:48, 12 May 2008 (CEST)

Compound expression for includematch

I am using two simple dpl statements that include the includematch statements:

includematch=/disclosure_type\s*=\s*[^|]*Proprietary Information/

and

includematch=/type\s*=\s*[^|]*Proprietary Information/

both of these work when used in simple statements but i'd like to combine then into one dpl query rather than 2.

i tried includematch=/disclosure_type\s*=\s*[^|]*Proprietary Information/,/type\s*=\s*[^|]*Proprietary Information/

and all of the items from the first query appear but none of the ones from the second. Can someone tell me what i am doing wrong, please.

Kay

I worked around this problem using variables and string functions. I concatenate mutliple regular expressions into one and use it in includematch statement. It's not trivial but work fine. See working example here.

Pierrem100 18:00, 26 October 2010 (UTC)

Even better, no need for these extensions if you use #dplvar and #dplreplace.

Pierrem100 19:21, 26 October 2010 (UTC)

Suggestion

You could try to use /(disclosure_)?type\s*=\s*[^|]*Proprietary Information/ but I am not sure what will happen. I am afraid DPL might only pick the first parameter (whichever it is). -- Gero 15:30, 30 June 2008 (CEST)

createdby/modifiedby

if username contains an underscore no results are returned

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

- --Ulli 757 23:04, 9 November 2008 (UTC)

notlastmodifiedby User 1 OR User 2

You can't combine 2 usernames in notlastmodifiedby?

{{#dpl:
 |ordermethod=lastedit
 |order=descending
 |notlastmodifiedby=Gero
 |notlastmodifiedby=Subfader
 |adduser=true
 |addeditdate=true
 |count=15
 |format=<ul>,\n<li>%USER% - %DATE% - [[%PAGE%|%TITLE%]]</li>\n,,</ul>
}}

--Subfader 19:34, 29 April 2009 (UTC)

I have this same question Lily 22:49, 25 December 2010 (UTC)

Simple template inclusion

Page "Test" uses Template:Test

{{Test.dpl|p1=aaa|p2=bbb}}
{{Test|p1=aaa|p2=bbb}}

Template:Test includes

{{#dpl:|title={{PAGENAME}}|include={Test}.dpl }}

Template:Test.dpl includes

{{{p1}}}--{{{p2}}}

Page Test renders as

aaa--bbb
%DPL-1.5.1-WARNING: No results!

This with Mediawiki 1.10.1. I tried using dpl version 1.9.0 but existing pages using dpl fail with this error (filed as an issue 23 Dec 09):

[23-Dec-2009 18:18:37] PHP Catchable fatal error: Object of class Title could not be converted to string in /.../mediawiki-1.10.1/includes/Revision.php on line 322

Should this work with 1.5.1? Perhaps I am misunderstanding how this is supposed to work? According to the revision history, 1.5.3 has a related bugfix, but AFAICT that shouldn't stop this from working.

Frank

How can I simply list all subpages of current page?

I want to list all subpages of a current page in my wiki which has the DPL extension installed. I.e. I want to list all subpages of {{FULLPAGENAME}}. What is then the correct syntax when using DPL ? --Syryos 23:21, 25 January 2010 (UTC)

Use this code, see also example Test Amp; you may want to add a slash so that similar pages are not matched --Gero 09:47, 26 January 2010 (UTC)
{{#dpl:
 | namespace = {{NAMESPACE}}
 | titlematch={{PAGENAME}}%
 | noresultsheader =  
 | resultsheader   = This page has the following subpages:<br/>
}}

Thanks. Regarding what you said "...to add a slash...": what do you mean exactly, do you mean {{PAGENAME}}/% ?
And, adding the column attribute may break this function when also using the header attributes, see quick analysis on example and further revisions. --Syryos 12:42, 26 January 2010 (UTC)

Add a linefeed after the header and everything works fine, see Test Amp. Indeed I was talking about a slash after the PAGENAME ..--Gero 13:35, 26 January 2010 (UTC)

Gero, thanks, okay. I suggest you document this fully featured example under a new section "How to neatly list subpages in columns" on the DPL main page (which does not mention the keyword subpage/s except for the keyword includesubpages but in a different context). The addition of a linefeed \n or &nbsp; to make the example working with the column option are (dirty?) tricks, I mean, the use is not very intuitive (how should an average user learn to know this?) and should therefore be please expressly commented. By the way, I was pointed to DPL by reading the book "Mediawiki".

How can the result list be output in case-insensitive sorted order. i.e. Main/apage then Main/Apage then Main/Bpage ? Currently I found the lowercase subpages (here: Main/apage) listed after the Main/Zpage. Is there a way to achieve this ? --Syryos 15:04, 26 January 2010 (UTC)

tablesortcol and distinct

I have a table generated by DPL that lists a series of pages and some values from templates on those pages. The table has "distinct=strict", as I don't want to see pages listed more than once. The last value in the table is an integer from 1 to 10. I tried adding "tablesortcol=12" (the last column), and it seems as if the "distinct" parameter is causing only the rows with distinct integers to show up in the result set. The table is getting sorted correctly by that last column, but only a portion of the results are showing up.

It's funny because my results header is printing out the correct number of pages it found (ex: 10), but the table that's displaying it is only showing the rows with distinct integers in the last column (ex: 3). I tried using "distinct=true" and see the same results.

Am I doing anything wrong? Is this a bug? --Gkullberg 16:31, 17 February 2010 (UTC)

Thanks for the precise report. It might be a bug. Could you produce a small example showing the effect here in this wiki? Then I may be able to track the problem down. Although it may take some time as I am busy with different things than DPL at the moment. --Gero 08:39, 18 February 2010 (UTC)
Done - Test Activity Query --Gkullberg 16:15, 18 February 2010 (UTC)

category=_none_ doesn't work

When I try category=_none_ I get:

Extension:DynamicPageList (DPL), version 1.8.9 : ERROR: Cannot perform logical operations on the Uncategorized pages (f.e. with the 'category' parameter) because the `dpl_clview` view does not exist on the database! Help: have the database administrator execute this query: CREATE VIEW `dpl_clview` AS SELECT IFNULL(cl_from, page_id) AS cl_from, IFNULL(cl_to, ) AS cl_to, cl_sortkey FROM `page` LEFT OUTER JOIN `categorylinks` ON `page`.page_id=cl_from.

And when I try to execute that SQL, I get:

  1. 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AS cl_to, cl_sortkey FROM `page` LEFT OUTER JOIN `categorylinks` ON `page`.pag' at line 1


Any ideas?

Thanks

Poveyjo

You must add an empty string at "IFNULL(cl_to,'') AS cl_to ...".
Note that between the comma and the closing bracket there are TWO SINGLE QUOTES, not a double quotation character. See also the HTML source of the file which contains the error message from DPL. Probably your browser swallowed the two single quotes. Gero 18:10, 28 May 2010 (UTC)


namespace=Image seems broken

Hi Gero, on my localhost I'm doing some tests in order to upgrade my wiki from 1.13.2 to latest 1.15.4. It seems all work fine except for DPL (I still have the old 1.7.4 and it works fine on 1.13.2): it returns the following error

%DPL-1.7.4-ERROR: Wrong '$0' parameter: 'namespace'! Help: $0= empty string (Main).

After a while a discover that as namespace parameter I have: namespace=Image that worked fine on 1.13.2. As per help, I changed Image with File and it worked again! Well, because Image is an alias for File this is not a great problem, of course... --GB 17:35, 20 June 2010 (UTC)

list with redirects

Sorry, I don't know if this is the right place to ask my question.

I want to generate a list that looks like this:

town a, list of all redirects to town a
town b, list of all redirects to town b
town c, list of all redirects to town c
town d, list of all redirects to town d
and so on

All the towns have the same category. Please can you help me to generate such a list? --Karinrobl 18:23, 24 October 2010 (UTC)

Well, here it is:
  • Town A

    Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#replace:Town A| |_}}' for parameter 'linksto'.


Extension:DynamicPageList (DPL), version 3.2.1: Error: No selection criteria found! You must use at least one of the following parameters: category, namespace, titlematch, linksto, uses, createdby, modifiedby, lastmodifiedby, or their 'not' variants


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

  • Town B

    Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#replace:Town B| |_}}' for parameter 'linksto'.


Extension:DynamicPageList (DPL), version 3.2.1: Error: No selection criteria found! You must use at least one of the following parameters: category, namespace, titlematch, linksto, uses, createdby, modifiedby, lastmodifiedby, or their 'not' variants


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

Gero 20:04, 30 October 2010 (UTC)

THANK YOU !!! --Karinrobl 05:23, 3 November 2010 (UTC)


Since some time this code doesn't work any more in GenWiki. The following output is produced:

¶# Abschruten (Ullosen) ← ²{Redirs¦Abschruten (Ullosen)}²¶# Adlig Heydekrug ← ²{Redirs¦Adlig Heydekrug}²¶# Alex Meschkeit ← ²{Redirs¦Alex Meschkeit}²¶# Alk ← ²{Redirs¦Alk}²¶# 

Can anybody help? What can I do to produce the old output? --Karinrobl 00:48, 8 July 2012 (CEST)

Did you move or change the Template:Redirs? If so, recreate it or make a new one. It should look like this:
{{#dpl:
  |linksto = {{{1}}}
  |redirects = only
  |format = ,, [[%PAGE%]],,
  |suppresserrors = true
}}
Does this help or does the problem persist? --Theaitetos 18:50, 10 July 2012 (CEST)

I didn't change this template. Nevertheless I tried your version of the template but the problem persists. --Karinrobl 21:20, 10 July 2012 (CEST)

Can you link me to the relevant pages on your wiki? --Theaitetos 03:43, 11 July 2012 (CEST)

Sure, here is the page that I use: [1]
I created a new page with the relevant code, that you can modify if you are registered ("Anmelden") in GenWiki: [2] Thank you --Karinrobl 10:36, 11 July 2012 (CEST)

Ich habe einmal ein Benutzerkonto beantragt. Falls es freigeschaltet wird, werde ich es mir ansehen. --Theaitetos 02:00, 13 July 2012 (CEST)

Vielen Dank, dass Du Dir das anschauen willst! Ich bin schon gespannt, was Du herausfindest.--Karinrobl 02:08, 13 July 2012 (CEST)

Ich habe bisher noch keine Freischaltung erhalten und habe es nochmals abgesendet. Kannst du einmal nachfragen was solange dauert? --Theaitetos 17:57, 17 July 2012 (CEST)

Ja, nach meiner Info müsstest Du jetzt freigeschaltet sein.--Karinrobl 20:36, 17 July 2012 (CEST)

Ich habe mich ein drittes Mal registrieren lassen, aber wurde immer noch nicht freigeschaltet: Logbuch. --Theaitetos 15:06, 24 July 2012 (CEST)

Das wundert mich sehr. Ich habe mit Uwe, einem Admin von GenWiki, deswegen telefoniert. Er hat mich später zurückgerufen und mir gesagt, dass er dich gerade (das war am 17.7.) freigeschaltet hat. Danach hatte ich dir hier geschrieben. Komisch. Vielleicht willst du selbst bei den Admins von GenWiki nachfragen, was da falsch läuft? Du erreichst sie unter GenWiki@genealogy.net und mich unter karin.robl@forum-leben.de --Karinrobl 15:35, 24 July 2012 (CEST)

includematch with phantom templates

Version 1
Title Published
The Colour of Magic 1983
Version 2
Title Published
Equal Rites
The Colour of Magic The Colour of Magic 1983
The Light Fantastic
The Light Fantastic 1983
The Smell of Future The Smell of Future 2013
Hello, I have a new problem! :-P It is about the includematch criteria in reference with a phantom template.
In Version 1 only the second template (Template:Book) seems to pass the includematch criteria, but not the first (or any previous) template although both have the parameter "Date" that should be tested. (A little more weirdness: In our wiki it's only the first template that is tested, and the other ones aren't).
In Version 2 it doesn't seem to test anything at all, and includes all pages that fit the other selection criteria. --Theaitetos 14:13, 27 December 2010 (UTC)
(1) There may be a misunderstanding on your side of the idea of phantom templates. Please read the manual carefully. A phantom template is called INSTEAD of the original template.
(2) The current syntax of includematch uses a logical AND if more than one match expression is given. In your application you would need a logical OR, however.
(3) The easiest way would be to use ONE COMMON template for BOOKS and MAGAZINES which takes an additional parameter to specify the type as a first parameter.
(4) It is possible to produce the kind of result you probably expect - even if you leave the templates as they are. See Table with template inclusions. You must use a variable to set a filter and the filter must be tested within the phantom templates. A document in category "publication" must always describe EITHER a magazine or a BOOK. Note that you must also provide empty phantom templates with extension ".default" which are called if a document does NOT use one of the two templates. So you end up with 4 templates (Template:Magazine.published,Template:Magazine.published.default, Template:Book.published,Template:Book.published.default).
(5) Personally I would recommend to create a template "named Publication". In that case you need only one includematch expression and things become a little more elegant.
Gero 09:38, 29 December 2010 (UTC)
Oh, now I see. Thanks a lot for the clarification, now I know where my mistake was.
We can't use the same template for all publications though for some other reasons, so I'll take the filtering with variable option. Thanks again.
On another thing, I'm not sure if my friend Orci posted it here, but we changed our DPL a little to fix a bug with tablesortcol based on a similar fix here. Just in case he didn't here's what we altered:

In Datei DPL.php ersetzte den folgenden Block

		// if requested we sort the table by the contents of a given column
		if ($iTableSortCol!=0) {
			$sortcol = abs($iTableSortCol) + 1;
			$rows=explode("\n|-",$rBody);
			foreach($rows as $row) {
				if (($word = explode("\n|",$row,$sortcol))!==false && count($word)>=$sortcol) {
					$rowsKey[] = $word[$sortcol - 1];
				} else {
					$rowsKey[] = $row;
				}
			}
			if ($iTableSortCol<0) 	krsort($rowsKey);
			else					ksort ($rowsKey);
			$rows=array_combine(array_values($rowsKey),$rows);
			ksort($rows);
			$rBody="\n|-".join("\n|-",$rows)."\n|-";	
		}

durch diesen hier:

		// if requested we sort the table by the contents of a given column
		if ($iTableSortCol!=0) {
			$sortcol = abs($iTableSortCol);
			$rows=explode("\n|-",$rBody);
			foreach($rows as $index => $row) {
				if (strlen($row) > 0) {
					if ((($word = explode("\n|",$row,$sortcol+2))!==false) && (count($word)>$sortcol)) {
						$rowsKey[$index] = $word[$sortcol];
					} else {
						$rowsKey[$index] = $row;
					}
				}
			}
			if ($iTableSortCol<0) 	arsort($rowsKey);
			else			asort ($rowsKey);
			$rBody="";
			foreach($rowsKey as $index => $val)
				$rBody.="\n|-".$rows[$index];
		}
Und einen guten Rutsch ins Jahr 2011! --Theaitetos 11:32, 29 December 2010 (UTC)
Edit:Despite the danger of being considered a "nub" now, but where do I activate the dplvar and dplreplace modules? I haven't found them in the functional richness settings. --Theaitetos 16:29, 29 December 2010 (UTC)
NO no, the problem is on my side! The DPLDEMO website runs a preliminary DPL version which is slightly ahead of the one published and this affects #dplvar and #dplreplace. Either send me a mail and I will return the ZIP file or use the "Variables" extension and the "StringFunctions" extension that come with the official version of DPL. In that case you would have to use #replace and #var instead of #dplreplace and #dplvar. The idea behind the change is to reduce dependencies ... Gero 19:10, 29 December 2010 (UTC)
Happy New Year 2011!
As I am not the one who is legally responsible for our wiki, it's not my decision. That's why we run with a very strict policy regarding extensions and only accept those that are marked in MediaWiki as "stable" and without security issues (our wiki has to deal with a lot of copyright issues which could break our neck). So I'll lobby to have the Variables and StringFunctions extensions installed some time soon. Thanks for the offer with the zip-file though; as soon as DPL is updated we make sure to get the latest version. DPL is a blessing for us, as the copyright restrictions allow us to only write down certain specifically allowed information, which is why we use a lot of template boxes, which then can be used for DPL. So we're more of a catalogue for sources, oversight and basic information than a true comprehensive wiki. Viel Glück mit den guten Vorsätzen in 2011! --Theaitetos 11:52, 2 January 2011 (UTC)

Excluding minoredits too strict?

When using "ordermethod= lastedit" together with "minoredits = exclude" pages will drop from the list even if a major edit occurred just before the minor one within the given timeframe.

IMO in that case DPL should select pages based on the last major edit instead of totally dropping the page. Or is there some other setting which would produce the described behavior? --nakohdo 18:02, 7 July 2011 (CEST)

creation date

--Evgeniy (talk) 22:20, 7 June 2013 (CEST) Hello, is there any way to select pages that were created after some date? (not modified but created)

I don't think so. Usually you would use Special:Newpages for such a task. --Theaitetos (talk) 16:13, 8 June 2013 (CEST)

Order by rows?

Is there any way to get output ordered in rows, rather than columns?

I want to see (for example):

• 1• 2• 3
• 4• 5• 6
• 7• 8• 9

but it seems DPL is hard-wired to order within columns:

• 1• 4• 7
• 2• 5• 8
• 3• 6• 9

Jan Steinman (talk) 08:15, 30 October 2014 (CET)


I know it sucks, but I just don't see any possibility atm to do so. Others have asked the same thing, but the answer still remains: Unless MediaWiki itself provides the support for such a switch, there's nothing that DPL in particular can do. Sorry. --Theaitetos (talk) 19:22, 30 October 2014 (CET)