Help:DynamicPageList3

From Constant Noble
Jump to navigation Jump to search

DynamicPageList3 (DPL3), a page-reporting tool, was enabled on this site as a substitute for Semantic MediaWiki in July 2021.[1] This list of usage examples is intended to compensate for the chronic outdatedness and apparent dearth/complexity of many currently available guides for this extension.

Basics

Based on Wikimedia's original DynamicPageList and its subsequent third-party fork, DPL3 is invoked by the {{#dpl: .... }} parser function or the <DPL>/<DynamicPageList> parser tags. Depending on the approach, all pages using these are automatically placed into Category:Pages using DynamicPageList3 parser function or Category:Pages using DynamicPageList3 parser tag (via {{Extension DPL}}, itself automatically created once the extension is enabled).

Escape characters

From the original DPL documentation at FollowTheScore.org:

Sometimes it is necessary to use a character as "plain data" at a place where it normally has a syntactical meaning. MediaWiki is not very clean at character escaping in general. So we had to define our own way in the jungle of "character escaping":

DPL escape character MediaWiki character Typical use
» > Call another MediaWiki extension into a parameter of a DPL call
« <
²{ {{ Call a template within the 'article loop' of DPL. This is especially useful for nesting DPL calls (DPL recursion)
}}
¦ |
newline Inserts a line break into DPL's wikitext output, to allow proper parsing of first-character syntax (such as * # : ;)
\n newline

DPL's mechanism of replacing %xx% variables then can be used to modify the arguments of that call before it will be resolved. Most DPL users will not need this, but for some advanced uses of DPL it is a real help.

Examples

Pages in category

This is the most basic function of DPL3. On this site, a list of characters from the Unspooled series can be generated with {{#dpl:category=Unspooled characters}} or <dpl>category=Unspooled characters</dpl>, resulting in:

(To reduce loading times, the result count is purposefully capped at 100 [but only takes effect once maxResultCount is set instead of allowUnlimitedResults by Miraheze staff].)

Most recently updated pages

To retrieve a list of project pages by most recent update, one can use:

<dpl>
namespace=Project
ordermethod=lastedit
order=desc
count=10
</dpl>

which gives the following output:

  • This code is only used as a demo to place this content into Category:Pages using DynamicPageList3 parser tag. In parser form, it is written as {{#dpl:namespace=Project |ordermethod=lastedit |order=desc |count=10}}.
  • |count= is intentionally used here to prevent a long list from dominating this section.

Scrolling through results

To get the previous and next five project pages alphabetically from a given position (e.g. "M"), use:

{{#dpl:title<=M|namespace=Project|order=descending|ordermethod=sortkey|count=5}}
{{#dpl:title>=M|namespace=Project|order=ascending|ordermethod=sortkey|count=5}}

to get:


The first segment of syntax respectively means "lower than M" and "higher than M", and the third tells DPL3 to go down or up the list.

This method is not effective on lists with mixed capitalisation and Unicode characters, as has recently been proven with {{Definition/Nearby}} on the entry pages of the Tovasala Dictionary.

Tables

DPL3 can also be used for table results, an example of which involves tracks in the Adanson Jukebox tagged under the Classical genre:

{{#dpl:category=Tracks|linksto=Genre:Classical
|include={Track box}:Artist:Composer\(s\):Lyricist\(s\):Length:Album:Date=¦Year:License:Appearances:AVA:Rating
|table=class="wikitable sortable discography",Track title,Artist,Composer(s),Lyricist(s),Length,Album,Release date,License,Appearances,{{abbr|Autrison Visual Album|AVA#}},{{abbr|As given by Autrison's curators|Rating}}
|tablerow=²{Artist¦%%}²,²{#if:%%¦%%¦—}²,²{#if:%%¦%%¦—}²,%%,²{#if:%%¦²{#switch:%%¦Single=Single-only release¦Download=Digital download¦#default=²{Album¦%%}²}²}²,%%,²{#if:%%¦%%¦Copyrighted}²,²{#arraymap:%%¦;¦##¦²{#ifeq:²{#sub:##¦0¦2}²¦4J¦²{Volume¦4J¦##}²¦²{Volume¦²{#sub:##¦0¦-4}²¦##}²}²¦\s•\s}²,%%|ordermethod=sortkey
}}

Track title Artist Composer(s) Lyricist(s) Length Album Release date License Appearances AVA# Rating
Act II Scene V: Gigue Helmuth Rilling, Gächinger Kantorei Stuttgart & Bach‐Collegium Stuttgart Johann Christian Bach 2:25 Amadis des Gaules 1990 Copyrighted RFB03.234 0963
Adagio Paul Pitman Ludwig van Beethoven 4:57 Piano Sonata No.1, Op.2 No.1 2010-09-03 CC-BY-SA 3.0 RFB03.222 0952 ★★★
Auf rief ein huebsches freuelein schumusik Traditional 0:55 Tricinien und Bicinien aus dem 15. und 16. Jhd. 2021-04-15 CC-BY-SA 3.0 RFB01.303 0097
Couplets de Folies Lucie Horsch & The Academy of Ancient Music Marin Marais 5:23 Baroque Journey 2019-02-22 Copyrighted RFB03.147 0928
Dear Land of Guyana, of Rivers and Plains U.S. Navy Band Robert Cyril Gladstone Potter Archibald Leonard Luker 0:53 National Anthems of the World 2014-08-28 PD-USGov RFB02.104I 0350
Denn alles Fleisch, es ist wie Gras The Holden Consort Orchestra and Choir Johannes Brahms 14:16 Ein deutsches Requiem 2001 CC-BY-SA 4J.09 0009
Derzhavnyi himn Ukrainy U.S. Navy Band Mykhailo Verbytskyi Pavlo Chubynskyi 1:20 National Anthems of the World 1994 PD-USGov RFB03.105IRFB04.105IRFB05.105IRFB06.105I 0891
Determination Timerity Tim MacMillar 4:09 2015-03-02 CC-BY 3.0 RFB03.TBA 0800
EG 362: Ein feste Burg ist unser Gott (zweite Version) Wolfgang Kindl Martin Luther 0:59 Angst und Vertrauen (EG 361 - 376) 2021-04-18 CC0 MT01.116MT02.117MT02B.118MT02C.114MT02D.118 0301
Ertöt uns durch dein Güte Alicia de Larrocha Johann Sebastian Bach 3:13 Essential Bach 2000-03-06 Copyrighted RFB01.507 0198
Four Ruffles and Flourishes and Hail to the Chief U.S. Navy Band James Sanderson Albert Gamse 0:49 Music for Honors and Ceremonies 1997 PD-USGov MT02D.129 0859
Freie Fantasie fürs Clavier in F-sharp minor, H300, Wq 67: VI. Adagio Marc-André Hamelin Carl Philippe Emanuel Bach 01:54 C.P.E. Bach: Sonatas & Rondos 2022-01-07 Copyrighted RFB03.337 1015
Gigue in D Major Stuttgart Chamber Orchestra & Karl Münchinger Johann Pachelbel 1:53 Pachelbel Kanon, Albinoni Adagio, and Other Baroque Favorites by Pachelbel, Bach & Handel 1978 Copyrighted RFB03.TBA 1100
Isle of Beauty, Isle of Splendour U.S. Navy Band Lemuel McPherson Christian Wilfred Oscar Morgan Pond 0:48 National Anthems of the World 2004 PD-USGov 4J.04IRF01.106IRF02.106IRF03.106IRF04.106IRFB01.105IRFB02.105IRFB03.106IRFB04.106IRFB05.106IRFB06.106I 0005
Kinderszenen, Op. 15: 7. Träumerei Daniel Barenboim Robert Schumann 2:38 Kinderszenen • Arabeske • Fantasie 1979-04-17 Copyrighted RFB03.113 0896
Largo Coleman & Cornish George Frideric Handel 4:18 Improvisations on Classics 2012-02-13 CC-BY 3.0 RFB03.134 0915
March On, Bahamaland U.S. Navy Band Timothy Gibson Timothy Gibson 1:15 National Anthems of the World 2003-05-03 PD-USGov RFB01.104IRFB03.104IRFB04.104IRFB05.104IRFB06.104I 0004
Musikalische Ergötzung, Suite in C Major, P. 374: IV. Ciacona Gli Incogniti & Amandine Beyer Johann Pachelbel 3:15 Pachelbel: Un orage d'avril 2016-02-19 Copyrighted RFB03.228 0957
Elgar: Variations on an Original Theme, Op. 36 (Enigma): 9. Nimrod (Adagio) Los Angeles Philharmonic & Zubin Mehta Edward Elgar 3:45 Enigma Variations / Symphony No. 1 1973 Copyrighted RFB03.315 0996
O Canada U.S. Navy Band Calixa Lavallée 1:19 National Anthems of the World 2003-05 PD-USGov RFB02.102IRFB03.102IRFB04.102IRFB05.102IRFB06.102I 0349
Orchestra Tuning Up Stan Smith & Ralph Harding 0:37 2011-07-24 Copyrighted 4J.02RF01.102RF02.102RF03.102RF04.102RFB01.102RFB02.101RFB03.101RFB04.101RFB05.101RFB06.101 0002
Praeambulum in D Bart Jacobs Heinrich Scheidemann 3:06 Ein feste Burg ist unser Gott: Luther and the Music of the Reformation 2017-02-10 Copyrighted RFB03.122 0904
Qui sedes ad dextram Patris Papalin Johann Sebastian Bach 4:06 Mass in B Minor, BWV 232 2011-06-17 CC-BY 3.0 RFB03.146 0927 ★★★
The Seven Last Words of Jesus Christ, op. 51, Hob. III:50-56: I. L'introduzione: Maestoso ed adagio Kodály Quartet Joseph Haydn 05:35 The Seven Last Words of Jesus Christ, op. 51 / String Quartet, op. 103 1990-03-01 Copyrighted RFB03.405 1024
Sonata a-Moll, BuxWV 272: III. Passacaglia La Rêveuse Dieterich Buxtehude 2:44 Sonates en trio: Manuscrits d'Uppsala 2017-02-02 Copyrighted RFB03.206 0937
The Star-Spangled Banner U.S. Navy Band John Stafford Smith Francis Scott Key 1:18 National Anthems of the World 1997 PD-USGov 4J.03IRF01.104IRF02.104IRF03.104IRF04.104IRFB01.103IRFB02.103IRFB03.103IRFB04.103IRFB05.103IRFB06.103I 0003
Symphony No. 9, Op. 125 – IV. Presto Papalin Ludwig van Beethoven 22:29 Symphony No. 9, Op. 125 2011-06-07 CC-BY 4J.10 0010 ★★★

Listing template values

To list Unspooled characters by species and residence, one can start with the same category=Unspooled characters call as before, then add include={Character box}:Species,{Character box}:Residence next to it. The resulting

{{#dpl:category=Unspooled characters
|include={Character box}:Species,{Character box}:Residence
}}

becomes:

Since the above output is not desirable, one should add interpuncts as |secseparators= (short for "section separators") in the DPL calls, one for each comma-separated "include":

Code Output
{{#dpl:category=Unspooled characters
|include={Character box}:Species,{Character box}:Residence
|secseparators=, • ,
}}

The second comma is mandatory, since leaving it out will cause the interpuncts to immediately glue to the next value.

In this example, the namespace must be stripped away for presentability, and another interpunct must separate the name and first value. Hence:

Code Output
{{#dpl:category=Unspooled characters
|include={Character box}:Species,{Character box}:Residence
|listseparators=,\n*²{Character¦%TITLE%}² • ,
|secseparators=, • ,
}}
  • Samson • Guadeloupe raccoon • Panama City, Florida
  • Edison • Raccoon • Panama City, Florida
  • Marguerite • Guadeloupe raccoon • Panama City, Florida
  • Alfred • Guadeloupe raccoon • Panama City, Florida
  • Matthew • Raccoon • Toronto
  • Bernadette • Raccoon • Roseau
  • Jeremiah • Raccoon • Roseau
  • Gertha • Guadeloupe raccoon • Roseau
  • Victor • Guadeloupe raccoon • Panama City, Florida
  • Galina • Ferret • Panama City, Florida
  • Louise • Isthmian raccoon • Panama City, Florida
  • Violet • Ring-tailed cat • Panama City, Florida
  • Seán • European otter • Panama City, Florida
  • Ibrahim • Red squirrel • Panama City, Florida
  • Andrew • Mouse • Panama City, Florida
  • Daniel • Dog • Panama City, Florida
  • Jean-Pierre • Dog • Kings Hill
  • Elliot • Isthmian raccoon • Vieux Fort
  • Nathaniel • Bahamian raccoon • Thunder Bay
  • Malaika • Guadeloupe raccoon • Toronto
  • Geraldine • Guadeloupe raccoon • Salisbury
  • Alban • Guadeloupe raccoon • Pointe-à-Pitre
  • Devondra • Guadeloupe raccoon • Les Abymes
  • Xavier • Guadeloupe raccoon • Pointe-à-Pitre
  • Rhea Silvia • Guadeloupe raccoon • Petit-Bourg
  • Mars • Guadeloupe raccoon • Petit-Bourg
  • Romulus • Guadeloupe raccoon • Petit-Bourg
  • Remus • Guadeloupe raccoon • Petit-Bourg
  • Hersilia • Guadeloupe raccoon • Petit-Bourg
  • Elsinore • Guadeloupe raccoon • Pointe-à-Pitre
  • Ludovic • Guadeloupe raccoon • Salisbury
  • Hayley • Isthmian raccoon • Vieux Fort
  • Wilhelmo • Cozumel raccoon • Hillsborough, Carriacou
  • Bernice • Cozumel raccoon • Hillsborough, Carriacou
  • Elenatina • Cozumel raccoon • Hillsborough, Carriacou
  • Charlie • Cozumel raccoon • Hillsborough, Carriacou
  • Agatha • Cozumel raccoon • Hillsborough, Carriacou
  • Dalilah • Red squirrel • Panama City, Florida
  • Maurice • Hispaniolan solenodon • Hillsborough, Carriacou
  • Florence • Isthmian raccoon • Vieux Fort
  • Cendrine • Isthmian raccoon • Micoud
  • Jodi • Isthmian raccoon • Vieux Fort
  • Miquela • Cozumel raccoon • St. George's
  • Elias • Raccoon •
  • Clarena • Guadeloupe raccoon • Pointe-à-Pitre
  • Calluna • Guadeloupe raccoon • Pointe-à-Pitre
  • Cosmelia • Guadeloupe raccoon •
  • Catriona • Guadeloupe raccoon • Pointe-à-Pitre
  • Daboecia • Guadeloupe raccoon • Pointe-à-Pitre
  • Liberta • Guadeloupe raccoon • Liberta
  • Ketiley • Guadeloupe raccoon •
  • Evelina • Guadeloupe raccoon • Pointe-à-Pitre
  • Guillaume • Guadeloupe raccoon • Pointe-à-Pitre
  • Grégoire • Guadeloupe raccoon • Pointe-à-Pitre
  • Tyllus • Guadeloupe raccoon • Pointe-à-Pitre
  • Amelia • Raccoon • New Haven
  • Lorelle • Guadeloupe raccoon • Pointe-à-Pitre
  • Ileana • Guadeloupe raccoon • Pointe-à-Pitre
  • Cantabrica • Guadeloupe raccoon • Pointe-à-Pitre
  • Béthune • Guadeloupe raccoon • Pointe-à-Pitre
  • Clément • Guadeloupe raccoon • Goyave
  • Mariam • Guadeloupe raccoon • Pointe-à-Pitre
  • Geoffroy • Guadeloupe raccoon • Pointe-à-Pitre
  • Ruthanna • Guadeloupe raccoon • Plymouth, Monsterrat
  • Francesca • Guadeloupe raccoon • Pointe-à-Pitre
  • Fabricia • Guadeloupe raccoon • Pointe-à-Pitre
  • Geralyn • Guadeloupe raccoon • Pointe-à-Pitre
  • Bertrand • Guadeloupe raccoon • Pointe-à-Pitre
  • Hobrey • Red panda • Panama City, Florida
  • Jim • Cat • Marigot, Dominica
  • Cantabrica IV • Guadeloupe raccoon • Le Gosier
  • Cantabrica III • Guadeloupe raccoon • Le Gosier
  • Cantabrica II • Guadeloupe raccoon • Le Gosier
  • Sarita • Guadeloupe raccoon • Pointe-à-Pitre
  • Nomena • Mouse • Panama City, Florida
  • Tamla • Eurasian lynx • Atlantic City
  • Marion • Snow leopard • Panama City, Florida
  • Dinah • Rabbit • Phillipsburg
  • Lana • Dingo • London, Ontario
  • Molly • Cat • Marigot, Dominica
  • Sylvestre • Guadeloupe raccoon • Pointe-à-Pitre
  • Childéric • Guadeloupe raccoon • Pointe-à-Pitre
  • Cain • Guadeloupe raccoon • Pointe-à-Pitre
  • Abel • Guadeloupe raccoon • Pointe-à-Pitre
  • Mireille • Guadeloupe raccoon • Pointe-à-Pitre
  • Hervé • Guadeloupe raccoon • Pointe-à-Pitre
  • Nassaire • Guadeloupe raccoon • Liberta
  • Berezina • Guadeloupe raccoon • Pointe-à-Pitre
  • Elysia • Guadeloupe raccoon • Pointe-à-Pitre
  • Olaudah • Guadeloupe raccoon • Liberta
  • Ceneressa • Guadeloupe raccoon • Pointe-à-Pitre
  • Eduardine • Guadeloupe raccoon • Pointe-à-Pitre
  • Seth • Guadeloupe raccoon • Pointe-à-Pitre
  • Naomi • Guadeloupe raccoon • Pointe-à-Pitre
  • Linda • Mouse • Panama City, Florida
  • Bartolomeu • Ferret • Carriacou
  • Shannon • Red fox • Wausau, Florida

Here, \n signifies a new line, and * a list item. What is otherwise typed out as {{Character|%TITLE%}} is converted into ²{Character¦%TITLE%}² for DPL3 purposes. The square symbol (²) substitutes the first and last template brace, and a broken pipe symbol (¦) takes the place of the full symbol. (The latter is absent on standard keyboards and WikiEditor's "Special characters" list, and must be added via CharInsert during editing.)

Finally, to convert the bare values into links, one must use |tablerow=:

Code Output
{{#dpl:category=Unspooled characters
|include={Character box}:Species,{Character box}:Residence
|listseparators=,\n*²{Character¦%TITLE%}² • ,
|secseparators=, • ,
|tablerow=²{Species¦%%}²,²{Place¦%%}²
}}

where in the template calls, %% represents the respective template value.

Regex-based output

Through titleregexp=, DPL3 can output a list of headwords in the Tovasala Dictionary whose letters do not exceed the "x-height" (inspired by this now-closed challenge at the Puzzling StackExchange):

Code Output
{{#dpl:namespace=Entry|titleregexp=^-?[acemnorsuvwz][acemnorsuvxwz]+-?$}}

The caret (^) signifies the start of the term; -? checks whether the term is an affix/termison/intrafix; and [acemnorsuvwz] looks for terms beginning with the "x-height" letters. (In Tovasala, c is represented by ch while lowercase x cannot begin a word.) [acemnorsuvxwz]+$ reiterates through the selected strings to find terms exclusively including those letters; the dollar sign signals the end of the target strings.

The {{#dplreplace:}} function operates similarly to the {{#replace:}} parser function and the localised {{ReplaceSet}}, but for alterations, {{!}} must be used for escape between the options searched for. (The regex syntax is also compatible with RegexFunctions' {{#rreplace:}}.)

Code Output
{{#dplreplace:catch a tiger by the tail|/(^{{!}}\s)(c{{!}}t(?!h))/|<nowiki> </nowiki>L}}
Latch a Liger by the Lail

Notes

  1. ^ After holding back its launch over various infrastructure/availability concerns, Miraheze introduced SMW on an experimental basis in April 2022.