Difference between revisions of "DPL Example 006"
From FollowTheScore
(New page: {{Example|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 ...) |
|||
Line 10: | Line 10: | ||
|addcategories=yes | |addcategories=yes | ||
}} | }} | ||
+ | ---- | ||
{{#dpl: | {{#dpl: | ||
|category=African Union member states | |category=African Union member states | ||
− | |notcategory= | + | |notcategory=English-speaking countries |
|addcategories=yes | |addcategories=yes | ||
}} | }} | ||
Line 25: | Line 26: | ||
|addcategories=yes | |addcategories=yes | ||
}} | }} | ||
+ | ---- | ||
{{#dpl: | {{#dpl: | ||
|category=African Union member states | |category=African Union member states | ||
− | |notcategory= | + | |notcategory=English-speaking countries |
|addcategories=yes | |addcategories=yes | ||
}} | }} |
Revision as of 07:10, 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.
{{#dpl: |category=African Union member states |addcategories=yes }} ---- {{#dpl: |category=African Union member states |notcategory=English-speaking countries |addcategories=yes }}
The above DPL command produces the following output:
- Somalia . . Categories: African Union member states | Arab League | Divided regions | East Africa | Pages with broken file links | Somalia
- Nigeria . . Categories: African Union member states | Constitutional republics | D8 nations | Economic Community of West African States | English-speaking countries | Former British colonies | G15 nations | Nigeria | Pages with broken file links | Peace and Security Council | Seafaring nations
- Cameroon . . Categories: African Union member states | Cameroon | English-speaking countries | French-speaking countries | La Francophonie | Pages with broken file links | Peace and Security Council
- Sudan . . Categories: African Union member states | Arab League | Arabic-speaking countries | Middle Eastern countries | Military dictatorship | North Africa | Pages with broken file links | Peace and Security Council | Sudan
- Somalia . . Categories: African Union member states | Arab League | Divided regions | East Africa | Pages with broken file links | Somalia
- Sudan . . Categories: African Union member states | Arab League | Arabic-speaking countries | Middle Eastern countries | Military dictatorship | North Africa | Pages with broken file links | Peace and Security Council | Sudan