Difference between revisions of "DPL Example 006"

From FollowTheScore
Jump to: navigation, search
Line 6: Line 6:
  
 
<pre><nowiki>
 
<pre><nowiki>
 +
OAU members
 
{{#dpl:
 
{{#dpl:
 
  |category=African Union member states
 
  |category=African Union member states
 
  |addcategories=yes
 
  |addcategories=yes
 
}}
 
}}
----
+
 
 +
English speaking countries, OAU or fictitious
 
{{#dpl:
 
{{#dpl:
 
  |category=Fictitious country
 
  |category=Fictitious country
 
  |addcategories=yes
 
  |addcategories=yes
 
}}
 
}}
----
+
 
 +
fictitious countries
 
{{#dpl:
 
{{#dpl:
  |category=African Union member states
+
  |category=African Union member states¦Fictitious country
  |notcategory=English-speaking countries
+
|category=English-speaking countries
 +
  |notcategory=French-speaking countries
 
  |addcategories=yes
 
  |addcategories=yes
 
}}
 
}}
Line 26: Line 30:
 
The above DPL command produces the following output:
 
The above DPL command produces the following output:
 
----
 
----
 
+
OAU members
 
{{#dpl:
 
{{#dpl:
 
  |category=African Union member states
 
  |category=African Union member states
 
  |addcategories=yes
 
  |addcategories=yes
 
}}
 
}}
----
+
 
 +
English speaking countries, OAU or fictitious
 
{{#dpl:
 
{{#dpl:
 
  |category=Fictitious country
 
  |category=Fictitious country
 
  |addcategories=yes
 
  |addcategories=yes
 
}}
 
}}
----
+
 
 +
fictitious countries
 
{{#dpl:
 
{{#dpl:
 
  |category=African Union member states¦Fictitious country
 
  |category=African Union member states¦Fictitious country

Revision as of 07:18, 11 March 2009

back to list of examples

Create a list of articles belonging (or not belonging) to certain categories

You can specify AND, OR and NOT conditions for categories: multiple specifications are treated as AND, within one specification you can use the pipe symbol for OR.

Note that you must escape the pipe character when using DPL as a parser function. You can use ¦ insetad of | or you can define a template which produces a pipe character.

 OAU members
{{#dpl:
 |category=African Union member states
 |addcategories=yes
}}

 English speaking countries, OAU or fictitious
{{#dpl:
 |category=Fictitious country
 |addcategories=yes
}}

 fictitious countries 
{{#dpl:
 |category=African Union member states¦Fictitious country
 |category=English-speaking countries
 |notcategory=French-speaking countries
 |addcategories=yes
}}

The above DPL command produces the following output:


OAU members
English speaking countries, OAU or fictitious
fictitious countries