Help:Dynamic Page List Function/Examples
From WaterWiki.net
Below are some further useful examples, illustrating the wide array of powerful functionalities DPL can be used for. Simply adapt these templates to create the DPL listings you require.
- Cop-Members by country
<DynamicPageList> category=Europe & CIS category=CoP-Member mode=ordered order=ascending </DynamicPageList>
- 5 most recently edited country pages, ordered by date edited (most recently edited first)
<DPL> category=country addeditdate=true ordermethod=lastedit order=descending count=5 addauthor=true shownamespace=true mode=ordered </DPL>
- 5 most recently edited country, region, water basin, publication or organisation pages, ordered by date edited (most recently edited listed first)
<DPL> category=country|Water_Basin|Region|publication|organization addeditdate=true ordermethod=lastedit order=descending count=5 addauthor=true shownamespace=true mode=ordered </DPL>
- Last 3 contributors to category "Kazakhstan", displaying date/time of edit and changes he/she made ("asterisk bar" indicates how many bytes in the article were changed by that user)
<DPL> category=Kazakhstan addeditdate=true ordermethod=lastedit order=descending count=3 addauthor=true addcontribution=true mode=ordered </DPL>
- Water basins ordered by country (e.g. Germany)
<DPL> category=Water Basin category=Germany mode=ordered </DPL>
- Most recent resources on a topic e.g. 10 most recently added resources on gender, showing last edit date and author
<DPL> category=Gender mode=ordered ordermethod=lastedit order=descending addauthor=true addeditdate=true count=10 </DPL>
- A list of all related pages, useful to list under "See also" (e.g. here all pages related to Kazakhstan, excluding CoP-Members/Cop-Contacts
<DPL> category=Kazakhstan mode=ordered notcategory=CoP-Member notcategory=CoP-Contact ordermethod=title order=descending </DPL>
- Top 5 "hitlist" of articles relating to a certain topic - (e.g. most popular pages related to Tajikistan)
<DPL> category=Tajikistan ordermethod=counter order=descending addpagecounter=true count=5 </DPL>
- List of all pages related to Hungary, dislaying the categories each page belongs to.
<DPL> category=Hungary addcategories=true </DPL>
- 10 most read/popular pages, displaying no. of times pages have been visited and their respective author.
<DPL> category=Country|Region|Publication|CoP-Member|Organization|Water_Basin ordermethod=counter order=descending addpagecounter=true addauthor=true redirects=include count=10 </DPL>
- 10 most recently edited pages showing last editor
<DPL> category=Country|Region|Publication|CoP-Member|Organization|Water_Basin ordermethod=lastedit order=descending addlasteditor=true addeditdate=true redirects=include count=10 </DPL>
- User's recent activity - the last 20 pages MODIFIED by a specific user (e.g. joe.bloggs), showing edit date and ordered by most recently edited first.
<DPL> category=Country|Publication|Water_Basin|Region|Organization|CoP-Member modifiedby=joe.bloggs mode=ordered ordermethod=lastedit order=descending addeditdate=true count=20 </DPL>
- Latest 10 pages CREATED BY a specific user (e.g. joe bloggs), ordered by most recently edited last. Does not show edit date.
<dpl> category=Water_Basin|country|publication|organisation|project mode=ordered ordermethod=lastedit createdby=joe.bloggs order=ascending count=10 </dpl>
- Number of pages relating to a certain topic (e.g Africa) and the 5 most viewed.
<DPL> category=Africa mode=userformat resultsheader=There are %PAGES% pages on Africa. </DPL> ;The most viewed are: <DPL> category=Africa mode=ordered ordermethod=counter order=descending addpagecounter=true addcategories=true count=5 </DPL>
- To list certain chapters/sections of articles in a specific category, use
<dpl> resultsheader=__NOTOC__ category=uganda category=project include=%5[100] secseparators=<br> </dpl>
DPL will list the first 100 characters of 5th chapter in all project pages in Uganda.
- To transclude (e.g. lessons learned from projects)
<DPL> category=Project namespace=0 include=#Lessons Learned </DPL>
DPL will list the lessons learned section from all projects in the 0 namespace.
- To create a map (e.g. of projects in Algeria)
<DPL> category=project category=Algeria category=Mapped mode=map </DPL>
To control the output of the map, use syntax mapopts=type:satellite;width:500px;height:600px etc controls map outputs

