DPL Example 023

From FollowTheScore
Revision as of 09:03, 20 June 2009 by Gero (talk | contribs)
Jump to: navigation, search

back to list of examples

Create a SORTED table of articles based on template parameters

This is basically the same as DPL Example 001.

DPL goes through all pages and initially builds an alphabetically sorted list of matching articles. We output the columns in different order (just for convenience) and then we use a small piece of javascript code to resort the table by column one. As we must insert the link to the article at column position two, we need an phantom template Template:Country.listByCapital to format the output of each line.

{{#dpl:
 |category=Fictitious country
 |include={Country}.listByCapital
 |table=class=sortable wikitable,-,Capital,Country,Official Name
}}
{{TableSortByColumn1}}

The above DPL command produces the following output:


Capital Country Official Name
DPL Example 007 main page 1
Bamitogoo Nigunda Republic of Nigunda
Bamitogoo Test Nigunda Test Republic of Nigunda Test
Aaaabququque Somango Somango Island

Template:TableSortByColumn1