Example 1

From FollowTheScore
Revision as of 17:25, 31 January 2007 by WikiSysop (talk | contribs)
Jump to: navigation, search

Our demo web site contains some articles on fictitious countries (this is also the name of their common category). Test5554--2008-02-16 best time ever--Nowa kategoria--Test 001--Test 002--Test 003--Test 004--Test 005--Test 006--Test 007--Test 008--Tmp2--2008/08/23 SD test--Event template zh-tw--Event intro zh-tw--A1--2008-04-24 nnn--Yyy--Ford--Property:Age--Student--Semantic MediaWiki with Property Clusters (print version)--Task act--Task think--Test what links here with categories page--Abc/def--Music--Page in Test-1--Physics--Page in Test 1--My very special event (2007/03/01)--DPLMATRIX--Mechanics--Philosophy--Bruxelles city--Town A--Town B--Task prepare meal--Task buy food--A ECP-00055 test page--Pseudo Namespace:Dummy--2007-08-24 jehhu--Test Dummy--Testpage--Test transclusion bug 2--Stachoo test--The Colour of Magic--The Smell of Future--Bug Apo--Article with underscore--The Light Fantastic--Page A--Page H--Todotest3--Page D--Page E--Activity Page 1--Activity Page 2--Fr--Chess--Cezanne--URL--A2--Trombone--Aa--Page--Text--Date--Taiwan--Email--Test calendar May 2007--Test calendar June 2007--Test calendar July 2007--Test calendar August 2007--Test calendar September 2007--Test calendar October 2007--Test calendar November 2007--Number--String--Boolean--Glossary--Z--Temperature--Todotest1--2009-06-26 asdf--Page B--Page C--Annotation URI--Page F--Signac--VolkoV Test A Cat B--VolkoV Test B Cat C--Bug Apo 3--Bug'Apo 4--'Bug Apo 5--2007-06-01 Test Event--Geographic coordinate--Distinct test--1007/05/26 Nice Calendar :)--2007/08/02 Holiday starts--00001--Van Gogh--Todotest2--Xxx--2007/05/11 Calender Check--Muro di Berlino--2007-06-21 boo waz here--2007-10-31 Holiday!--YYYY-12-24 Christmas Eve--YYYY/mm/dd my event name--2007/06/12 some other event--2007-07-18 EPAF--DPL Example 007 main page 2--Test Amp/2--2007/05/29 TEST EVENT--2007/06/15 Test2 event--DPL Example 007 sub page 11--DPL Example 007 sub page 12--DPL Example 007 sub page 21--DPL Example 007 sub page 22--DPL Example 007 sub page 23--DPL Example 007 sub page 24--DPL Example 007 sub page 25--DPL Example 007 sub page 26--2007/06/24 Desparate--Munich--2007-08-29 Workshop--2007-08-13 testing--Berlin--207/05/10 Bolwing--2007/07/31 !!!!!!!!!!!!!!!!!--2007/07/25 St Jaume!--Paris--Page G--Gallery 3--2007/04/22 test1--2007/06/09 Test by tao.li--Page size test page 1--Test Amp2--Bob Jones Out Sick--2009-01-24 test2--2007/05/19 Update--2007-06-09 My Vacation Day--Table Bug 4--2007-11-27 Test number 12345--Some Article 6--Heidelberg--Table Bug 3--VolkoV Test C Cat A--2008-04-24 xml--2009-01-01 iyo test--2007-04-19 test 19th april--2007/12/25--2007-09-05 Out of office--Vienna--2008-04-01 test--UNTITLED--CC--2008-02-28 party--2008-08-31 SRM recovery test--19/04/2007 stpeterkomet--2008-01-29 Test2--Test 1.13 issue--City B--2007-02-15 My very special event--2007-04-19 Test Florian--2007-06-03 Project Alpha--Test Simple Forms 2--2007/06/13 ok--2007-08-31 19:00 Vorstandssitzung--2007/06/05 Evenement maintenance--2007/06/30 Month name not displaying--2007/05/25 TEST--Ploticus Demodata--2007/06/16 Paul's Event--2007/06/22 haha--W:de:Benutzer:Unendlich--2007/10/31 Halloween--Table Bug 2--2007-08-30 Installation Calendar in personal wiki--Equal Rites--2007-04-05 Some Event--2007/07/25 craig birthday--2007/04/06 my event--2007/06/30 gave up to install this calendar--2007/07/07--2007/04/03 vacantion--2007/08/28 today is the day--2007-09-15 my evers--2007/04/03 Daniels verjaardag--Piano--2009-06-28 butt day--Gallery 3 sub--2007/07/17 Mom's B-day--2007/06/29 FS ToDo--DPL Example 007 main page 1--2007/04/30 Mon événement--2007-08-23 testing--Bug SQL 1064--2007/06/07 Gaudium in Poing--2007/08/05 notiso--Flute--An article which is only referenced by a DPL query--2007-08-05 shit happens--Test5555--Muha Test--Test uses--2007/07/30 Я ухожу в отпуск--2008-10-31 Project1 Kick-off--2009-07-02 vacaciones--2007/07/04 Jeremy BDay--2007/05/17 test event--MtiTrans1--MtiTrans2--MtiTrans3--Berliner Mauer--2007-03-30 My very special event--2007/03/05 third test event--2010-02-14 San Valentín--2007/04/28 my event name--2007/05/03 my event name--2008/11/12 Test--2007/05/25 algo--2007-08-10 birthdaytest--2007/05/09 WooHoo--2007/05/26 pvp--2007/05/31 Bladadadmam--2007/06/04 en la fing--2007/06/06 Test--2007/06/22 test--2007/6/11 try out calendaring in mediawiki--2007/06/15 Kevin out today--2007/06/22 hello--YYYY/mm/dd FSTest--2007/07/10 A new wiki is born--2007-07-13 Friday 13th--2007-05-19 DIMON--2008-04-24 wwww--2008-08-28 vtest testing--2010-05-05 testowy event--Templates in Redirection--2007-04-25 March for rights--2007/06/03 June event--2007/06/01 some event--2007/04/26 some event--05/04/2007 Chris--2007/04/30 Un autre événement--2007/05/03 hghg--2007/05/05 hackeln--2008-09-28 I think I have it working--2007/04/16 my test event--/mm/dd my event name--2007-07-15 Baiardi--2007/07/31 my bday--2007-03-05 test event two--2007-08-10 iso8601test--2007/03/06 prova--2007-09-01 ABC Birthday--YYYY-mm-dd my event name--Nitin--2007-09-06me me me--2007-09-21 Day after tomorrow--2007/07/02 Boulot--2007/06/24 just another test--Some Article 4--2007-07-22 Jocs especials a la Trinitat--2007/04/25 DougTest--2007/05/02 Sat Test--2007/03/05 Test Event--2007 04 03 daniels verjaardag--2007/04/05 my event name--2007-09-22 test--2007/05/07 take wife out for movie -- Spiderman?--2007/04/18 this events is still upcomng--2007-01-01 Tims Test--2007/07/07 testing cool--2007/02/05 test test test--Test debug--2009-07-02 implantación--2007-08-02 mew--Berlin Wall--2007/05/03 Training Basketball Team--2007/06/13 Wiki meeting at 12 PM--Oktoberfest--Datetest--Bassoon--Test unescaped SQL--Manet--2007/08/15 my event name--City A--2007/06/14 Practice Cal Entry--2007-12-25 Xmas Day--2007/06/21 milestone 4--MissingTocMain2--AbC--Test linksfrom 2--2007/06/13 Sat and Russ Event--2008-01-30 today by kd--Random Chapter Content 1--Random Chapter Content 2--Random Chapter Content 3--2007/07/27 FooBar's event--5/3/07 8PM new event--DPL Example 029/DummyPage--Sandbox--Tablesort and columns--2007/06/22 sprawdzanie kalendarza--Some Article 5--Renoir--2007/07/05 Post 4th Party--2008-May-23 deliver assortment to Maple Ave--2010-11-25 Anniversary--2007/07/25 finally--2007-10-17 milestone - tests completed--Nig1--Nig2--Test inx Nuts--Shamim's Note--2007/07/26 Greg's Event--MissingTocMain--Nig3--2007/08/22 this is just a test--2007/03/29 Something is happening--B--Test Amp/1--Test inx Fruit--2007-09-29 Viajó Ana Feli a USA--ECP-00001--Test inputbox--Test matches--2007/09/15 better not forget anniversary!!--2007-09-28 Cours--2007-11-05 Scary Monsters!--2007/05/01 launch blogzapfel!--2007-09-30 Just a check--Holzmaden--Nig4--2007-09-30 Another quick test--2007-12-01 Meeting--Some other trips--DPL Example 019--Republic of Cape Verde--Test onlyinclude - included page--Lucie--2007-06-06 Meeting in Paris--Class car--Tony--Republic of Burundi--MapDemo--2007/04/27 iloveEvents--Some Article 3--2007/04/28 中文--Republic of Cameroon--2007-12-20 Blablabla--I3:Matrix1--YYYY-MM-27 Test calendar--Class test--Class Game--Class vehicle--Class Subject--Cache Demo 2--ECP-00000--ECP (Form)--Events--Test reset categories--Article connected by DPL category keyword--Test matrix2--Henry--France--Eric--Some Article 2--Italy--YYYY-MM-25 prepare plan for next month--Class Location--2007-08-22 The Birthday Party--DPL Example 024--Test subcategories--Class Person--Class Freshman--People 2--Germany--Republic of Madagascar--2007-09-28 my birthday; send me many gifts!--New Issue (Form)--2007-08-01 Masterplan: World domination--YYYY-10-03 National Holiday in Germany--Test linksto--Class Musical Instrument--Abc--Spain--Translation list--Y--Test2--Test what links here with categories--MtiMain--MtiMain2--Example 3a--防DDOS模块mod evasive的使用说明出自开源百科--2007-09-20 Tsotha-Lanti meets Britney Spears--Harry Potter--Hermione Jean Granger--United Republic of Tanzania--People 1--Muha Test 2--Test regexp--Example 4--Test Sort order--Lisa--Test--2008-06-30 something clever--Activity 1--Activity 2--Activity 3--Turnier Gruppe2--DPL Example 011--New Issue (Intro)--Tom--Test columns--测试内容--我来测试wiki--Test what links here--Class Student--SMWpc Documentation API Category--Test what links here 2--DPL Example 010 page 1--DPL Example 010--Test transclusion bug data--DPL Example 021--Test ignorecase--Nigunda Test--Table with template inclusions--Test calendar previous month--Current events--Resultsheaderwithcolumns--Bug sortkey--Test goal--Execandexit not setting dplvars--Some Article 1--Test category cloud sub--DPL Example 002--DPL Example 012--DPL Example 103--Test redirects--Buloma--Some trips--DPL Example 025--Test offset&count--Test cat listing--DPL Example 009--Grube Messel--Test imagecontainer--SMWpc Documentation API ObjectForm--Test escapelinks--Current events zh-tw--Extension Ploticus--Event intro--Table bug--Test revisions--Inputbox extension--Test shownamespace--Somango--DPL Example 028--Test title--Tmp--Test onlyinclude--DPL Example 018--Patch to LinkHoldersArray--Test Simple Forms--Test export--SMWpc Documentation API Type--Test article structure--DPL Example 001--A--DPL Example 102--Examples of including a template--Tatiana Nahas--DPL Example 101--Page size test page 2--SMWpc Documentation API Model--Test category listing--SMWpc Documentation API Instances--Test section inclusion--Interface list--Apache服务器架设的简单,由小P发布--Test date formatting--DPL Example 005--DocTypes Example--Turnier Gruppe--Peter--Test calendar February 2007--DPL Example 004--DPL Example 026--2007-06-06 London Wiki Wednesday--Test calendar April 2007--Test calendar March 2007--Test adduser--Test category cloud--Test linksfrom--Listing Redirects and Location--StripMarkup extension

They all use a template named "Country" which has parameters like capital. The template produces a small table and a link to the country list we want to generate. There are chapters on religion and history in most of the articles. We show how to create a sortable wikitable list of those articles which gives some excerpts of the contents. <javascript src="sorttable"/>

DPL can be used as a mediawiki parser extension, which means that a special DPL tag is used:

parser extension syntax

<DPL>
  category=Fictitious country
  includepage={Country} dpl,#History,#Religion[20]
  addpagecounter=true
  mode=userformat
  listseparators=\n{|class=sortablewikitable id=123 \n!Country \n!Official Name \n!Capital \n!Dial Code \n!History \n!Religion \n|-,\n|-\n|[[%PAGE%]] (%COUNT%)\n,\n,\n|}
  secseparators=,\n|,,
</DPL>

We select articles by category ("Fictitious Country") and explain that we want to see contents from the template "Country" and from two chapters. We truncate the text on religion to a maximum of 10 characters. We create a sortable table which contains the article name (as a link) and its access frequency in the first column and the content pieces in the other columns. Note that at the end of truncated contents you will find a small arrow which links directly to the chapter from where the contents was taken. The formatting for the template variables is done in a special template which is by convention named after the original tenmplate plus a suffix (Template:Country dpl in our case). This template is very simple; it only presents the values for name, capital and dial code as columns of a table.

country list
Country Official Name Capital Dial Code History Religion
DPL Example 007 main page 1 (%COUNT%)

Template:Country dpl.default

Nigunda (%COUNT%) Republic of Nigunda Bamitogoo 237

some facts about ..→

Nigunda Test (%COUNT%) Republic of Nigunda Test Bamitogoo Test 237

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

some facts about ..→

Somango (%COUNT%) Somango Island Aaaabququque 224

a text on the history of Somango; a text on the history of Somango; a text on the history of Somango;

some facts about ..→

country list (2)

DPL can also be used as a mediawiki parser function, which is more powerful as it allows DPL to be used within templates, parameters being template calls or variable expansions. The disadvantage is that syntax looks less nice as the pipe character must be hidden in macros if used as a parameter contents. So the same example could also have been written as:

parser function syntax

{{#dpl:category=Fictitious country
  |includepage={Country} dpl,#History[50],#Religion
  |addpagecounter=true
  |mode=userformat
  |listseparators=\n{{(!}} class=sortablewikitable id=123
    \n!Country
    \n!Official Name
    \n!Capital
    \n!Dial Code
    \n!History
    \n!Religion
    \n{{!}}-,\n{{!-}}\n{{!}}[[%PAGE%]] (%COUNT%)\n,\n,\n{{!)}}
  |secseparators=,\n{{!}},,
}}

The result:


Country Official Name Capital Dial Code History Religion
DPL Example 007 main page 1 (%COUNT%)

Template:Country dpl.default

Nigunda (%COUNT%) Republic of Nigunda Bamitogoo 237

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

Nigunda Test (%COUNT%) Republic of Nigunda Test Bamitogoo Test 237

Nigunda Test History - Chapter Sequence in the ..→ some facts about religious groups in Nigunda; some other facts about religious groups in Nigunda Test;

Somango (%COUNT%) Somango Island Aaaabququque 224

a text on the history of Somango; a text on the ..→ some facts about religion in Somango



Have a look at a more realistic example ...