Difference between revisions of "DPL:FAQ"

From FollowTheScore
Jump to: navigation, search
(Can DPL be used to create a subcategory listing with articles listed under their category)
Line 1: Line 1:
 
__TOC__ __NEWSECTIONLINK__
 
__TOC__ __NEWSECTIONLINK__
 +
 +
== I want to create a "Category Cloud." How do I change the font size based on the number of articles for a category?==
 +
 +
Here's what I've got so far...
 +
 +
<DPL>
 +
categorymatch=%
 +
goal=categories
 +
mode=userformat
 +
listseparators=,[[%PAGE%|%TITLE%]]
 +
inlinetext=&nbsp;&nbsp;
 +
</DPL>
  
 
== My article name contains underscores, but in the DPL result they won´t appear. ==
 
== My article name contains underscores, but in the DPL result they won´t appear. ==

Revision as of 01:30, 25 March 2008

I want to create a "Category Cloud." How do I change the font size based on the number of articles for a category?

Here's what I've got so far...

Somalia  Main  Nigeria  African Union member states  Cameroon  !  Nigunda  Somango  Sudan  Merrick at Isubu funeral.jpg  Example 1  Test headingmode  Test addcategories  Test adduser  Test shownamespace  Test addfirstcategorydate  Test escapelinks  Frankfurt  Munich  Hamburg  Cities  Germany  Countries  Belgium  Antwerpen  Nigunda Test  Fictitious country  Buloma  Place  Test date formatting  Test section inclusion  Test mode category  Manual  Test  Test linksto  Test matches  Test uses  Type  ...  SAP MM Interfaces  SAP FI Interfaces  Test revisions  Test title  Test regexp  Test  My very special event (2007/03/01)  2007-03-30 My very special event  Events  2007-02-15 My very special event  CalendarSingle  Calendar/MonthStartThu  Calendar link  Test linksfrom  Calendar/MonthStartMon  Calendar/MonthStartTue  Calendar/MonthStartWed  Calendar/MonthStartFri  Calendar/MonthStartSat  Calendar/MonthStartSun  2007/04/05 my event name  2007/03/29 Something is happening  Test createdby  2007 04 03 daniels verjaardag  2007/04/03 Daniels verjaardag  2007/04/16 my test event  2007/04/03 vacantion  2007/04/18 this events is still upcomng  2007-04-19 test 19th april  Test subcategories  Oktoberfest  2007/05/01 launch blogzapfel!  19/04/2007 stpeterkomet  2007-04-19 Test Florian  2007-04-25 March for rights  Test numberOfArticles  2007/04/06 my event  Test redirects  2007/04/22 test1  2007-04-05 Some Event  2007/04/27 iloveEvents  2007/04/25 Hello from Japan  Test noeditsection  2007/04/25 DougTest  2007/06/03 June event  2007/06/01 some event  2007/04/26 some event  2007/04/28 my event name  2007/04/28 中文  05/04/2007 Chris  2007/04/30 Mon événement  2007/04/30 Un autre événement  5/3/07 8PM new event  2007/05/03 my event name  2007/05/03 hghg  2007/05/05 hackeln  2007/05/03 Training Basketball Team  2007/05/07 take wife out for movie -- Spiderman?  Calendar month  Test category hierarchy  Test offset&count  Test identical chapters  Test onlyinclude  Test onlyinclude - included page  2007-06-06 London Wiki Wednesday  2008/11/12 Test  207/05/10 Bolwing  2007/05/11 Calender Check  Test goal  2007/05/25 algo  1007/05/26 Nice Calendar :)  2007/05/19 Update  2007-01-01 Tims Test  2007/02/05 test test test  2007-08-10 birthdaytest  2007/05/09 WooHoo  Manual - DPL parameters: Controlling output order  2007/05/26 pvp  2007/06/05 Evenement maintenance  2007/05/31 Bladadadmam  2007/05/29 TEST EVENT  YYYY/mm/dd my event name  2007-06-01 Test Event  2007/06/21 milestone 4  2007-06-03 Project Alpha  2007/06/07 Gaudium in Poing  2007/05/02 Sat Test  2007/06/04 en la fing  2007/06/06 Test  2007/06/22 test  2007/06/30 gave up to install this calendar  2007-06-09 My Vacation Day  2007/06/09 Test by tao.li  2007/06/12 some other event  2007/08/02 Holiday starts  2007/6/11 try out calendaring in mediawiki  2007/07/17 Mom's B-day  2007/07/04 Jeremy BDay  2007/06/13 Sat and Russ Event  2007/06/13 ok  2007/06/14 Practice Cal Entry  2007/06/15 Test2 event  2007/06/13 Wiki meeting at 12 PM  2007/06/15 Kevin out today  2007/06/16 Paul's Event  Event template  2007/07/07 testing cool  2007/07/25 craig birthday  2007/07/07  2007/06/22 haha  2007-06-21 boo waz here  2007/06/22 hello  2007-07-18 EPAF  2007/06/24 just another test  2007/06/24 Desparate  2007/05/17 test event  YYYY/mm/dd FSTest  2007/06/29 FS ToDo  2007/06/30 Month name not displaying  2007/07/02 Boulot  2007/07/05 Post 4th Party  Wgraph  2007/07/10 A new wiki is born  2007/09/15 better not forget anniversary!!  2007/10/31 Halloween  2007/12/25  2007-07-13 Friday 13th  2007-05-19 DIMON  2007/07/30 Я ухожу в отпуск  2007/07/31 !!!!!!!!!!!!!!!!!  /mm/dd my event name  2007-07-15 Baiardi  2007/05/25 TEST  Republic of Cameroon  Republic of Cape Verde  Republic of Burundi  United Republic of Tanzania  Test includematch  2007-08-29 Workshop  2007/07/26 Greg's Event  Manual  Manual - DPL Bug Reporting and Feature Requests  DPL Manual  Manual - Authors and History  Manual - DPL Special Page with Parameters  Manual - General Usage and Invocation Syntax  Manual - DPL with PostgreSQL  Manual - DPL parameters: Controlling output format  Manual - DPL parameters: Controlling output order  Manual - DPL parameters: Controlling output volume  Manual - DPL parameters: Criteria for page selection  Manual - DPL parameters: Other parameters  Websites using DPL  Manual  Wgraph Manual  Version History  2007-07-22 Jocs especials a la Trinitat  Sample Genealogy  Sample Genealogy 2  Genealogy Comment  Genealogy Graph  Sample Genealogy 3  Genealogy Person  Sample Genealogy 4  Genealogy Data  Sample Genealogy 5  Person.wgl  Person.tab  Person  Dynasty Smith 1  Sample Genealogy 6  Dynasty Smith 2  Sample Genealogy 7  Demo Dynasty X  Sample Genealogy 8  Version History  Fundamentals  Architecture  Known Bugs  Requests for new features  Installation  Websites using Wgraph  Discussion  Commandline arguments  Tutorial  Tutorial identifiers  Tutorial node layout  Tutorial shapes  Tutorial size  Tutorial strings  Tutorial types  Example 1  Example 2  Van Gogh  Renoir  Cezanne  Manet  Example 3  Signac  Example 4  2007/07/27 FooBar's event  Resultsheaderwithcolumns  2007/07/25 finally  Table bug  Table Bug 2  Table Bug 3  Table Bug 4  TableBug  DPL bugs  List templates  Test resultsheader  Manual - Source and Installation  2007/07/31 my bday  2007/07/25 St Jaume!  Nosigr  2007/08/28 today is the day  2007/08/22 this is just a test  2007/03/05 Test Event  2007-03-05 test event two  2007/03/05 third test event  Page size test page 1  Page size test page 2  2007-08-10 iso8601test  2007/08/05 notiso  Bob Jones Out Sick  2007-08-13 testing  2007/08/15 my event name  Example Timebar  Example Holiday Planner  Tutorial edge layout  Test columns  Tutorial graph layout  2007-08-31 19:00 Vorstandssitzung  2007-08-22 The Birthday Party  2007/03/06 prova  2007-10-31 Holiday!  2007-08-24 jehhu  North Africa  2007-08-23 testing  2007-08-01 Masterplan: World domination  2007-08-02 mew  2007-09-01 ABC Birthday  2007-08-05 shit happens  2007-08-30 Installation Calendar in personal wiki  Test Sort order  VolkoV Test A Cat B  VolkoV Test B Cat C  VolkoV Test C Cat A  VolkoV  Nig1  Nig2  Nig3  Nig4  CountryA  CountryB  2007-09-05 Out of office  Test table  YYYY-mm-dd my event name  Test debug  Nitin  Plan  Execute  Task buy food  Task prepare meal  Task think  Task act  2007-09-15 my evers  2007-09-06me me me  2007-09-21 Day after tomorrow  2007-09-22 test  2007-09-20 Tsotha-Lanti meets Britney Spears  2007-09-22 Ward off the eels  2007-09-28 my birthday; send me many gifts!  Test ignorecase  2007-09-28 Cours  Events  2007-11-05 Scary Monsters!  2007-12-01 Meeting  Including Sections  Error message - undefined Index 100  DPL and Glossary clashing  Chinese message texts are wrong  False result count  Include positional template parameter  2007-09-30 Just a check  2007-09-30 Another quick test  Upgraded to 1.11 Notice: Undefined variable  2007-09-29 Viajó Ana Feli a USA  2007-10-17 milestone - tests completed  Test addcontribution  Inconsistent node height  Surprising bahaviour of forcedir layout  Change alignment procedure for labels  Allow vertical alignment of node labels  YYYY-10-03 National Holiday in Germany  YYYY-12-24 Christmas Eve  Test category listing  Minor changes in border affect forcedir layout strongly  Respect multiple borders in layout  Includematch parameter regexp issue  Gallery  !!  Simply does not work  Call - passing a variable twice  Question regarding fstraight phase  Demo font  Subgraph dimensions exceed graph size  Dirty edge option crashes program  YYYY-MM-25 prepare plan for next month  AiSee crash due to several near edges  Iconpath for svg  Phenomena with icons  Fisheye problem  Listing Redirects and Location  Headingmode definition buggy output  AddContribution missing prefix  Returns 0 results even when resultsheader is used  Layout irregularity with bent edges  Assigning absolute position of 0-0  Offset should be implemented at SQL level, not PHP  Adduser  Subgraph labels with line breaks  Line styles look different in png and svg  Splines on subgraph level  Select discussion by category of talk page  DT Article Header  DT Article Intro (Form)  DT Article Wiki (Form)  DT Article copy  DT Article copy (Intro)  DT Article show Refs  DT Articles list Wiki  DT Articles list XML  DT Category  DT Form Field  DT Form Field Ref  DT Form Field Text  DT Form Header  DT Scripts index  DT Type create  DocTypes  Randomseed  Manual - dplchapter  No More Globals  DT Article  DT Article Edit (Intro)  DT Article Edit (Intro).de  DT Article Edit (Syntax)  DT Article Edit (Syntax).de  DT Article Help (Intro)  DT Article Help (Intro).de  DT Article Intro (Intro)  DT Article Intro (Intro).de  DT Article Wiki (Intro)  DT Article Wiki (Intro).de  DT Article XML (Intro)  DT Article XML (Intro).de  DT Article copy (Intro).de  DT Articles list HTML  DT Articles list Wiki export.default  DT Articles view (Intro)  DT Articles view (Intro).de  DT Form Field Link  DT Form Field Newline  DT Language  DT Link  DT Meta  DT Ref  DT Report create  DT Report create (Intro)  DT Report create (Intro).de  DT Type create (Intro)  DT Type create (Intro).de  DT XML Field Text  DocType  Location  Location.intro  Location  France  Germany  Italy  Trip  Trip  Some trips  Trip.intro  YYYY-MM-27 Test calendar  DocTypeForm  Person  Person  People 1  Specific enhancements for 'table from template' DPL  Modularize DPL Code  Asking a calendar kit  Person.intro  DT Articles list csv  People 2  DT Article csv (Intro)  DT Article csv (Intro).de  Some other trips  Included Template Name Matching  2007-06-06 Meeting in Paris  2007-11-27 Test number 12345  2007-12-20 Blablabla  Request For %TOTALPAGES% Token  2007-12-07 Michael's event test1  2007-12-06 Michael's event test  2007-12-08 Other test  2007-12-09 dpl group's event test  Calendar month zh-tw  CalendarSingle zh-tw  2007-12-25 Xmas Day  Give me more Ploticus Demo, please  Calendar  Event template zh-tw  Could you help me to find out my calendar bugs  The include Parameter and Mulitple Template Invocations  DPL-1.6.3 error message  Error with using Sementic form in a wiki site  Dynamic Page List  DPL Calendar's i18n adventage and bug  Test matrix  Manual - dplmatrix  Asking a parser "replace " demo  Calendar - range  Calendar - without event template  Calendar - combine create event and dayview  Collation  Type?.intro  DPL error code "DynamicPageList2.php on line 2238"  Shamim's Note  Database issues after upgrade 1.10 to 1.11  2008-01-29 Test2  Users removing date from name  ECP number maker  ECP-00000  ECP  ECP List  ECP (Form)  I want demo a number register system  ECP-00001  SMW Demo  Peter  Bassoon  Lucie  Chess  2008-01-30 today by kd  List (transclude) sections of a page  Mneme  2008-02-28 party  Count and %PAGES%  RSS from DPL?  Category option that does AND operation to multiple parameters  Article count is wrong  Include option only in the main namespace ?  Child DPL doesn't works  2008-04-24 wwww  Some Page 1  Some Topic  Another Topic  Some Page 2

My article name contains underscores, but in the DPL result they won´t appear.

Normally, DPL replaces all undercores in article names by spaces when showing the result. You can replace underscores by their symbolic html name via the 'replaceintitle' statement. So DPL will no longer recognize the underscores and later the html engine will translate the symbolic name to underscores.

This wiki contains an Article_with_underscore. Normally DPL would show it as . But with {{#dpl:titlematch=%underscore|replaceintitle=/ /,&#95;}} you will get

When I use multi-column output my background color is cluttered

There is a special parameter named rowcolformat which allows to set the background color, cell-spacing etc. in combinaton with 'columns=' or 'rows='. See also DPL:Requests_for_new_features_Archive#Global background-color.

When I write a "What links here" DPL query, redirections are ignored

Say you have an Article A1 which links to B and an Article A2 which links to B2. But B2 is redirected to B.

{{#Wgraph: name=FAQ1 | png | thumb=50 |

 node A1 {color=green}
 node A2 {color=green}
 node B  {color=red}
 node B2 {color yellow}
 edge A1 B {}
 edge A2 B2 {}
 edge B2 B {label = #REDIRECT }
 orientation = left_to_right

}}

A standard DPL query using

linksto = B

will only deliver Article A1 because the default is to ignore #redirects.

redirects = include
linksto = B

will give you Article A1 and B2 as B2 redirects to B. But this may not be what you want. You still won´t get A2 as it links to B2 and not to B. The trick is to get the direct links to B in the normal way and to use a nested subquery which finds the pages which link to pages that redirect to B. We write the query in a way that it accepts the name of the target page (B) as a parameter:

Template:LinksToWithRedirect
----------------------------
 {{#dpl:
  |linksto={{{1}}}
 }}
 {{#dpl:
  |linksto={{{1}}}
  |redirects=only
  |format=,²{LinksTo¦%PAGE%}²,
 }}

Template:LinksTo
----------------
 {{#dpl:
   |debug=1
   |linksto={{{1}}}
   |format=,*[[%PAGE%¦%TITLE%]]\n,
 }}

Now calling {{LinksToWithRedirect|B}} will return A1 and A2.


See also Listing Redirects and Location

Getting pages with references to templates with particular parameters

With DPL you can find all pages which use a certain template. You can specify that you only want to see those articles where a ceratin parameter of that template has a certain value. You can even allow for a group of values if you use the power of regular expression as the following examples shows:

Let's say that your company uses a wiki to assign and keep track of tasks. So, let's say that you have created a todo template which, as a parameter, takes the name, username, or some other semblance of a name of a person responsible for the task. If you now want to see the tasks which have been assigned to a given person you could use something like

<dpl>
    uses        = Template:Todo2
    include     = {Todo2}:1,{Todo2}:2
    includematch= /\|(Sam Brown)|(Brown)|(SBrown)/i
    table       = ,,Person,Task
</dpl>

which produces

Content page Person Task
Todotest1 Brown, Sam To be done by Brown, Sam
Todotest2 Sam Brown To be done by Sam Brown
Todotest3 SBrown have to do what it says by SBrown

Note that the "i" makes the regexp case insensitive, so 'sbrown' would also match.

Inserting spaces and comma in the output

Just use the numeric html alias for comma: &#44;; you may want to have a space after that 'comma', so line wrapping will work normally:

{{#dpl:category=MyItems|listseparators=,[[%PAGE%|%TITLE%]]&#44; ,,}}

I want the article list separated by comma

There is a mode called 'inline' which does what you want.

mode=inline
inlinetext=,&nbsp;

This will give something like Nig1Nig2Nig3Nig4

Why does my deleted page still appear on Special:Wantedpages?

When a page is categorized such that it appears in a DPL query and is subsequently deleted, it will immediately disappear from the DPL query results. However, depending on how long the page has been around, it will temporarily still appear on Special:Wantedpages and navigating to the page's What Links Here page will still show the DPL query page as a page that links to it.

To get it to stop that unruly behavior, do one of the following:

  • Wait awhile (an hour or so). The wiki will sort this out over time in a background process.
  • Execute 'php runJobs.php' in the maintenance folder of your MediaWiki installation
  • Open the DPL query page in edit mode and save it again (this will add to your Recent Changes page)
  • Add reset=all in a final DPL query on the query page (see here.) This has other side effects - read about it first.

Why does my deleted page still have a link to a query page in its What Links Here list?

The answer to this is already in the previous section, but we wanted you to be able to find your question anyway.

How do I 'see' the wikitext my DPL generates?

There is a simple trick to DEBUG your DPL script:

Use a resultsheader and a resultsfooter to enclose all DPL output in pre and nowiki tags like this:

<dpl>
  ...
  resultsheader=<pre><nowiki>
  resultsfooter=</nowiki></pre>
  ...
</dpl>

NOTE: since version 1.4.2 you can also use the debug parameter. Just set "debug=5" in your DPL!

How do I offset an ordered list by a certain number?

Use the format statement and define an offset for the list:

<dpl>
  category=Fictitious country
  format=<ol start="4">,<li>%PAGE%</li>,\n,</ol>
</dpl>
  1. DPL Example 007 main page 1
  2. Nigunda
  3. Nigunda Test
  4. Somango

Can DPL improve the MediaWiki search dialogue?

You can use DPL to show a list of files which match the search expression.

You could change your Mediawiki:Noexactmatch template as follows:

  '''There is no page titled "$1".''' You can [[:$1|create this page]].
  <dpl>
    debug=1
    resultsheader=    ''There are some pages similar to '$1':''\n
    titlematch=%$1%
    ignorecase=yes
  </dpl>

As an example enter 'rep' into the searchbox of this wiki and watch the response page.

How do I create tabular output?

The answer is (surprisingly) quite simple. There are a several of different methods depending on the data you want. Example A) and B) below return page 'meta-data'. Example C) below returns data on the page itself, either from within specific page sections or from templates used on the page.

A) A table of page meta-data;

The 'parser function' syntax of the DPL ({{#dpl:...) gives the cleanest looking code, and is used below for that reason. However, the regular <DPL> syntax works in an identical way but with different layout.

{{#dpl:
  |category       = Country
  |count          = 10
  |mode           = userformat
  |addauthor      = true
  |addpagesize    = true
  |addpagecounter = true
  |addfirstcategorydate = true
  |userdateformat       = d-m-Y
  |listseparators = 
    {¦ class="sortable"
      \n! 
      \n! Date
      \n! Name
      \n! Author
      \n! Views
      \n! Size
    \n¦-,
      \n¦ align="right" ¦ %NR%
      \n¦ align="right" ¦ %DATE%
      \n¦ align="left"  ¦ [[%PAGE%]]
      \n¦ align="left"  ¦ [[User:%USER%¦%USER%]]
      \n¦ align="right" ¦ %COUNT%
      \n¦ align="right" ¦ %SIZE% B,
    \n¦-\n,
    ¦}
}}

Gives;

Date Name Author Views Size
1 02-09-2007 Nig1 Gero  %COUNT% 166 B
2 02-09-2007 Nig2 Gero  %COUNT% 166 B
3 02-09-2007 Nig3 67.41.66.71  %COUNT% 174 B
4 03-09-2007 Nig4 67.41.66.71  %COUNT% 198 B
5 05-09-2007 Category:CountryA 67.41.66.71  %COUNT% 301 B
6 05-09-2007 Category:CountryB 67.41.66.71  %COUNT% 301 B

The key to understanding how this works is;

  1. understand DPL basics (link?),
  2. understand table syntax, and
  3. understand the listseparators parameter.

Once you understand these things you will understand the above DPL.

B) The same table of page meta-data using the 'table' parameter;

I wish I knew how to do this...

The 'table' parameter is designed to create tabular output for elements which come from an include statement. So you would have to use a surrogate template ('phantom template') which could use the %variables%. But this works only if there exists a template which each of your article uses exactly once. So, normally you will have to use the approach shown above .
Gero 15:45, 18 September 2007 (CEST)
Can you show us how would it would look? (Assuming we had a template that was used in each page exactly once). --Dmb 21:29, 20 September 2007 (CEST)

C) A table of page section or template data;

See Test table.

I try to generate table formatting with DPL but it looks weird - to hell with the syntax!

Indeed, complex queries can be somewhat tricky. But this is not only a problem of DPL. MediaWiki is quite sensitive to blanks and linefeeds and half of your problems will probably come from there.

There is a simple trick how you can DEBUG your DPL script:

Use a resultsheader and a resultsfooter to enclose all DPL output in pre/nowiki tags like this:

<dpl>
  resultsheader=<pre><nowiki>
  resultsfooter=</nowiki></pre>
  titlematch=Nig%
  include=%1[300]
  format={|class=wikitable\n!article\n!beginning\n|-,\n[[%PAGE%|%TITLE%\n,\n,\n|}
</dpl>

You can also simply set debug=5 to achieve the same effect.

If we execute the above query (without the debug header/footer) the result will be deeply unsatisfactory:

[[Nig1|Nig1 [[Nig2|Nig2 [[Nig3|Nig3 [[Nig4|Nig4 [[Nigunda Test|Nigunda Test Nigunda Test History - Chapter Sequence in the article doesn´t matter for DPL .. [[Nigunda|Nigunda some facts about religious groups in Nigunda; some other facts about religious groups in Nigunda;[[Nigeria|Nigeria
Main article: History of Nigeria
See also: Nigerian military juntas of 1966-1979 and 1983-1998
More than 2,000 years ago. the Nok..→
article beginning

But why?


With our little trick we can watch the output of DPL which would normally be immediately rendered by the wiki parser:

{{Extension DPL}}{|class=wikitable
!article
!beginning
|-
[[Nig1|Nig1]]


[[Nig2|Nig2]]


[[Nig3|Nig3]]


[[Nig4|Nig4]]


[[Nigunda Test|Nigunda Test]]

Nigunda Test History - Chapter  Sequence in the article doesn´t matter for DPL ..


[[Nigunda|Nigunda]]

some facts about religious groups in Nigunda; some other facts about religious groups in Nigunda;


[[Category:Tag_Event2]]

[[Nigeria|Nigeria]]

:<div class="noprint">''Main article: [[History of Nigeria|History of Nigeria]]''</div>
:<span class="boilerplate seealso">''See also: [[:Nigerian military juntas of 1966-1979 and 1983-1998|Nigerian military juntas of 1966-1979 and 1983-1998]]''</span>
More than 2,000 years ago. the [[Nok]]  [[Nigeria#History|..→]]

|}

And now we see: After the |- the next table row does not start with a '|'; and, apart from that, there is no "end of row" after each article. Now it is easy to correct the DPL query:

<dpl>
  titlematch=Nig%
  include=%1[300]
  format={|class=wikitable\n!article\n!beginning\n|-,\n|\n[[%PAGE%|%TITLE%]],\n|-,\n|}
  secseparators=\n|\n,
</dpl>

.. and we get the desired result:

article beginning

Nig1

Nig2

Nig3

Nig4

Nigunda Test

Nigunda Test History - Chapter Sequence in the article doesn´t matter for DPL ..

Nigunda

some facts about religious groups in Nigunda; some other facts about religious groups in Nigunda;

Nigeria

Main article: History of Nigeria
See also: Nigerian military juntas of 1966-1979 and 1983-1998

More than 2,000 years ago. the Nok ..→


In our "debugger" it looks like this:

{{Extension DPL}}{|class=wikitable
!article
!beginning
|-
|
[[Nig1|Nig1]]
|
|-
|
[[Nig2|Nig2]]
|
|-
|
[[Nig3|Nig3]]
|
|-
|
[[Nig4|Nig4]]
|
|-
|
[[Nigunda Test|Nigunda Test]]
|
Nigunda Test History - Chapter  Sequence in the article doesn´t matter for DPL ..

|-
|
[[Nigunda|Nigunda]]
|
some facts about religious groups in Nigunda; some other facts about religious groups in Nigunda;


[[Category:Tag_Event2]]
|-
|
[[Nigeria|Nigeria]]
|
:<div class="noprint">''Main article: [[History of Nigeria|History of Nigeria]]''</div>
:<span class="boilerplate seealso">''See also: [[:Nigerian military juntas of 1966-1979 and 1983-1998|Nigerian military juntas of 1966-1979 and 1983-1998]]''</span>
More than 2,000 years ago. the [[Nok]]  [[Nigeria#History|..→]]
|-
|}

Where can I talk about DPL?

Try here;

Using multiple categories with phantom template

I am absolutely indebted to the work on DPL. I pulled my hair out for 2 days trying to figure out a way to do this. One thing I can't figure out is using a phantom template with multiple categories separated by | will only return results from the category listed first. I have:

{{#dpl:
|category=Maintenance 2007 Week 41|Maintenance 2007 Week 42
|include={Infobox Maintenance}:date:start:end:page
|count=8
|table=class=maint,-,Date,Start,End,Title
}}

It only will display the output (correctly - date, start, end, page) from whichever category I list first, although it does it correctly. Is there anything I can do to fix this?

Here is one of my call to Infobox Maintenance in Category:Maintenance 2007 Week 42

{{Infobox Maintenance
|title=Scheduled Maintenance on hosting environment
|date=10/17/2007
|start=4:00 AM
|end=8:00 AM
|description=blablah
}}
I think your problem lies in the pipe symbol. If you use the parser function syntax like you did in your first query the mediawiki parser will grab each '|' and will think it found the beginning of a new parameter. Try to escape the | by using {{!}} and you probably will get the correct result. Apart from that problem I wonder why you don´t get an error message. I think I will have a look at that. Gero 19:48, 15 October 2007 (CEST)
I had a look at the code and found that parameters which do not contain a "=" sign are silently ignored. In the next release there will be a warning in such situations. This should be enough to draw your attention to the pipe symbol, I guess.
A last remark: This document is the wrong place for problem reports. Please reply after you solved your problem and then I will remove the entry here. We use the Issue documents for problem reports. Gero 20:12, 15 October 2007 (CEST)
That works perfectly! Thanks for the quick response for a project that I have been under pressure to complete. I wasn't sure where to place the question. I assumed there was--Xigxag 21:28, 16 October 2007 (CEST) a problem with my syntax usage, not an issue with the extension. Thanks for the help and your hard work. --Xigxag 03:49, 16 October 2007 (CEST)
Another question - How would I go about suppressing the dpl no results warning message when using in the context above? I use |noresultsheader= but it doesn't seem to work.
use debug=1 or put a html comment (or a non breaking space nbsp;) directly after the noresultsheader= clause. Gero 08:43, 16 October 2007 (CEST)
Ah great. Things are looking quite nice now. I am going to look into using the calendar in the future. Thanks again. --Xigxag 21:28, 16 October 2007 (CEST)

Can DPL be used to post text based on category of current page?

I would like to print different output depending on the category of the current page. For example, if the current page is in category "able", "baker" should print, otherwise "charlie". --C4duser 19:48, 22 November 2007 (CET)


DPL can easily be used for that. title is filled with the current FULLPAGENAME and [no]resultsheader is used to create the output. Care should be payed to the fact that we must accept the current page as part of the query result (se skipthispage).

<nowikli>
  {{#dpl:title={{FULLPAGENAME}}|skipthispage=no|category=able|resultsheader=baker|noresultsheader=charlie}}
</nowiki>


I need to use a comma in my regexp but DPL uses the comma as a separator ..

Use \x2c in yopur regexp. The hex code 2c (dec. 44) is equivalent to a comma within a regular expression.

Can DPL be used to create statistics per user?

I would like to use DPL to create information on a given user, as follows:

  • Total number of edits for all articles.
  • Earliest edit date for all articles.
  • Total number of articles edited.

Is this possible? If so, could you give an example.

Thanks.

--C4duser 16:02, 31 December 2007 (CET)


Have a look at the scattergram which I put on the homepage of this wiki (see Scatter Demo 2). You might use a similar approach.

Gero 09:42, 2 January 2008 (CET)

Can DPL be used to create a subcategory listing with articles listed under their category

If I've got a category Colors with sub categories, Greens and Red, How can I automatically get a listing as follows

Colors

      Green
          Articles in category green
      Red
          Articles in category red

but using the category=*Colors in the DPL query.

This works if I use a pipe separated list of Categories category=Red|Green , but was hoping to avoid having to do this.

Any help, very much appreciated.

Mark

Reply

You can use nested queries. Create an outer query that returns all subcategories of 'Color' and use the format= parameter to output the result in a way that it can be used as an argument for the categories= parameter of the inner query.

Gero 14:06, 7 February 2008 (CET)